/* ================================================================
   SYSTEM MAILINGOWY – style.css (niezależny od projektu ankiet)
   ================================================================ */

:root {
    --n-bg:        #f4f6fb;
    --n-surface:   #ffffff;
    --n-hover:     #f3f4f6;
    --n-border:    #e5e7eb;
    --n-text:      #1a2332;
    --n-sub:       #475569;
    --n-muted:     #6b7280;
    --n-primary:   #4a6cf7;
    --n-primary-d: #3b5bdb;
    --n-success:   #16a34a;
    --n-danger:    #dc2626;
    --n-warning:   #d97706;
}

[data-theme="dark"] {
    --n-bg:        #11161f;
    --n-surface:   #1a212e;
    --n-hover:     #222a3a;
    --n-border:    #2c3548;
    --n-text:      #e6e9f0;
    --n-sub:       #aab2c5;
    --n-muted:     #7d869c;
    --n-primary:   #6c8cff;
    --n-primary-d: #4a6cf7;
    --n-success:   #34d399;
    --n-danger:    #f87171;
    --n-warning:   #fbbf24;
}

/* ===== TRYB JASNY (domyślny) Logowanie ===== */
:root {
    --bg-body:   #f0f4ff;
    --bg-card:   #ffffff;
    --bg-input:  #ffffff;
    --text-main: #1a2332;
    --text-sub:  #4a5568;
    --text-muted:#8a9bb5;
    --border:    #e2e8f0;
    --primary:   #4a6cf7;
    --shadow:    rgba(74,108,247,0.12);
}

/* ===== TRYB CIEMNY Logowanie ===== */
[data-theme="dark"] {
    --bg-body:   #0f1629;
    --bg-card:   #1a2332;
    --bg-input:  #2d3748;
    --text-main: #e8edf5;
    --text-sub:  #a0b4c8;
    --text-muted:#6b809a;
    --border:    #2d3748;
    --primary:   #6c8cff;
    --shadow:    rgba(0,0,0,0.35);
}


* { box-sizing: border-box; }

body {
    background: var(--n-bg);
    color: var(--n-text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    font-size: 14px;
}

a { text-decoration: none; }

.n-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    background: var(--n-surface);
    border-bottom: 0px solid var(--n-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.n-topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--n-text);
}
.n-topbar-logo .logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--n-primary), #6c8cff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.n-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}
.n-topbar-divider {
    width: 1px;
    height: 22px;
    background: var(--n-border);
}

.n-theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}
.n-theme-toggle .icon {
    font-size: 13px;
    color: var(--n-muted);
}
.n-toggle {
    position: relative;
    width: 46px;
    height: 24px;
    background: var(--n-border);
    border-radius: 50px;
    cursor: pointer;
    transition: background .2s;
}
.n-toggle.active { background: var(--n-primary); }
.n-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--n-warning);
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: left .25s ease;
}
.n-toggle.active .n-toggle-knob {
    left: 24px;
    color: var(--n-primary);
}

.n-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
    white-space: nowrap;
}
.n-btn:active { transform: scale(0.97); }
.n-btn-sm { padding: 5px 10px; font-size: 12px; }

.n-btn-primary {
    background: var(--n-primary);
    color: #fff;
}
.n-btn-primary:hover { background: var(--n-primary-d); }

.n-btn-ghost {
    background: transparent;
    border-color: var(--n-border);
    color: var(--n-sub);
}
.n-btn-ghost:hover { background: var(--n-hover); border-color: var(--n-primary); color: var(--n-primary); }

.n-btn-success {
    background: var(--n-success);
    color: #fff;
}
.n-btn-success:hover { filter: brightness(0.92); }

.ml-btn-warning { color: var(--n-warning); border-color: var(--n-warning); }
.ml-btn-warning:hover { background: rgba(234,88,12,0.1); }

.n-btn-danger-ghost {
    background: transparent;
    border-color: var(--n-border);
    color: var(--n-danger);
}
.n-btn-danger-ghost:hover { background: rgba(220,38,38,.08); border-color: var(--n-danger); }

.n-btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--n-danger);
    border: 1px solid var(--n-border);
    transition: background .15s, border-color .15s;
}
.n-btn-logout:hover { background: rgba(220,38,38,.08); border-color: var(--n-danger); }

.n-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--n-border);
    border-radius: 8px;
    background: var(--n-surface);
    color: var(--n-text);
    font-size: 13px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.n-input:focus {
    outline: none;
    border-color: var(--n-primary);
    box-shadow: 0 0 0 3px rgba(74,108,247,.12);
}
textarea.n-input { resize: vertical; font-family: 'Consolas', 'Courier New', monospace; font-size: 12.5px; line-height: 1.6; }

.n-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--n-sub);
    margin-bottom: 5px;
}

.n-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.n-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.n-stat {
    background: var(--n-surface);
    border: 1px solid var(--n-border);
    border-radius: 12px;
    padding: 18px;
}
.n-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-bottom: 10px;
    color: #fff;
}
.n-stat-icon.blue   { background: linear-gradient(135deg, #4a6cf7, #6c8cff); }
.n-stat-icon.green  { background: linear-gradient(135deg, #16a34a, #34d399); }
.n-stat-icon.purple { background: linear-gradient(135deg, #9333ea, #c084fc); }
.n-stat-icon.orange { background: linear-gradient(135deg, #ea580c, #fb923c); }
.n-stat-icon.red    { background: linear-gradient(135deg, #dc2626, #f87171); }
.n-stat-icon.teal   { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.n-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--n-text);
    line-height: 1.2;
}
.n-stat-label {
    font-size: 12px;
    color: var(--n-muted);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .n-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 769px) and (max-width: 1100px) {
    .n-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1101px) and (max-width: 1300px) {
    .n-stats { grid-template-columns: repeat(4, 1fr); }
}

.n-card {
    background: var(--n-surface);
    border: 1px solid var(--n-border);
    border-radius: 12px;
    overflow: hidden;
}
.n-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 0px solid var(--n-border);
    background: var(--n-hover);
}
.n-card-head-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--n-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.n-card-body { padding: 20px; }

.n-card-head.head-blue   { border-bottom: 0px solid #4a6cf7; }
.n-card-head.head-blue   .n-card-head-title i { color: #4a6cf7; }
.n-card-head.head-green  { border-bottom: 0px solid #16a34a; }
.n-card-head.head-green  .n-card-head-title i { color: #16a34a; }
.n-card-head.head-purple { border-bottom: 0px solid #9333ea; }
.n-card-head.head-purple .n-card-head-title i { color: #9333ea; }
.n-card-head.head-orange { border-bottom: 0px solid #ea580c; }
.n-card-head.head-orange .n-card-head-title i { color: #ea580c; }
.n-card-head.head-red    { border-bottom: 0px solid #dc2626; }
.n-card-head.head-red    .n-card-head-title i { color: #dc2626; }
.n-card-head.head-teal   { border-bottom: 0px solid #0d9488; }
.n-card-head.head-teal   .n-card-head-title i { color: #0d9488; }

.n-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    background: var(--n-hover);
    color: var(--n-muted);
    border: 1px solid var(--n-border);
    flex-shrink: 0;
    white-space: nowrap;
}
.n-chip.primary { background: #eff6ff; color: var(--n-primary); border-color: #bfdbfe; }
.n-chip.success { background: #f0fdf4; color: var(--n-success); border-color: #bbf7d0; }
.n-chip.warning { background: #fff7ed; color: var(--n-warning); border-color: #fed7aa; }
[data-theme="dark"] .n-chip.primary { background: #1e2a3a; border-color: #2d4a6e; }
[data-theme="dark"] .n-chip.success { background: #1a2e1a; border-color: #1f4a1f; }
[data-theme="dark"] .n-chip.warning { background: #2e2416; border-color: #4a3a10; }

.ml-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.ml-login-card {
    background: var(--n-surface);
    border: 1px solid var(--n-border);
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,.08);
}
.ml-login-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--n-primary), #6c8cff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.ml-login-title { font-size: 19px; font-weight: 800; color: var(--n-text); margin-bottom: 4px; }
.ml-login-subtitle { font-size: 13px; color: var(--n-muted); margin: 0; }

.ml-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--n-muted);
}
.ml-empty i { font-size: 2.2rem; display: block; margin-bottom: 10px; opacity: .5; }
.ml-empty p { font-size: 13px; margin: 0; }

.ml-list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 0px solid var(--n-border);
    transition: background .12s;
}
.ml-list-row:hover { background: var(--n-hover); }
.ml-list-row:last-child { border-bottom: none; }
.ml-list-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--n-hover);
    color: var(--n-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.ml-list-info { flex: 1; min-width: 0; }
.ml-list-name { font-size: 13px; font-weight: 700; color: var(--n-text); }
.ml-list-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

.ml-row-actions { 
	gap: 4px; 
	flex-shrink: 0; 
	margin-top: 10px
}


.ml-btn-warning { color: var(--n-warning); border-color: var(--n-warning); }

.ml-camp-row {
    margin-bottom: 14px;
    padding: 18px 20px;
    border: 1px solid var(--n-border);
    border-radius: 12px;
    background: var(--n-surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.15s;
}

.ml-camp-row:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.ml-camp-row:last-child {
    margin-bottom: 0;
}



.ml-camp-info { flex: 1 1 320px; min-width: 0; }
.ml-camp-name { font-size: 14px; font-weight: 700; color: var(--n-text); }
.ml-camp-subject { font-size: 12px; color: var(--n-sub); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.ml-camp-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.ml-progress-wrap {
    margin-top: 10px;
    height: 6px;
    background: var(--n-border);
    border-radius: 4px;
    overflow: hidden;
}
.ml-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--n-primary), #6c8cff);
    border-radius: 4px;
    transition: width .4s ease;
}

.n-col-left,
.n-col-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.n-col-left .n-card,
.n-col-right .n-card {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.n-col-left,
.n-col-right {
    padding-top: 0;
    padding-bottom: 0;
}

@media (max-width: 1199px) {
    .n-col-left,
    .n-col-right {
        gap: 16px;
    }
}

.ml-placeholder-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--n-hover);
    border: 1px dashed var(--n-border);
    border-radius: 7px;
    font-size: 11px;
    color: var(--n-muted);
    line-height: 1.8;
}
.ml-placeholder-hint code {
    background: var(--n-surface);
    border: 1px solid var(--n-border);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--n-primary);
    font-size: 11px;
    margin: 0 2px;
}

.ml-preview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.ml-preview-stat {
    text-align: center;
    padding: 12px 6px;
    background: var(--n-hover);
    border: 1px solid var(--n-border);
    border-radius: 9px;
}
.ml-preview-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--n-text);
}
.ml-preview-stat-value.ok   { color: var(--n-success); }
.ml-preview-stat-value.warn { color: var(--n-warning); }
.ml-preview-stat-label {
    font-size: 10px;
    color: var(--n-muted);
    margin-top: 3px;
    line-height: 1.3;
}
.ml-preview-info {
    font-size: 12px;
    color: var(--n-sub);
    padding: 10px 12px;
    background: var(--n-hover);
    border-radius: 8px;
    margin-bottom: 14px;
}
.ml-preview-sample-label {
    font-size: 11px;
    color: var(--n-muted);
    margin-bottom: 6px;
}
.ml-preview-sample-label code {
    color: var(--n-primary);
    font-weight: 600;
}

.ml-unsub-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 18px;
    border-bottom: 0px solid var(--n-border);
    font-size: 12px;
}
.ml-unsub-row:last-child { border-bottom: none; }
.ml-search-excluded { display: none !important; }

.ml-radio-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--n-sub);
    cursor: pointer;
    padding: 5px 12px;
    border: 1px solid var(--n-border);
    border-radius: 99px;
    transition: background .15s, border-color .15s, color .15s;
}
.ml-radio-pill input { display: none; }
.ml-radio-pill:has(input:checked) {
    background: var(--n-primary);
    border-color: var(--n-primary);
    color: #fff;
}

.ml-settings-box {
    background: var(--n-hover);
    border: 1px solid var(--n-border);
    border-radius: 10px;
    padding: 16px;
}
.ml-settings-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--n-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ml-cron-box {
    padding: 12px 14px;
    background: var(--n-surface);
    border: 1px solid var(--n-border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--n-sub);
    line-height: 1.7;
}
.ml-cron-box code {
    display: block;
    margin-top: 6px;
    padding: 8px 10px;
    background: var(--n-hover);
    border-radius: 6px;
    font-size: 11px;
    color: var(--n-primary);
    word-break: break-all;
    font-family: 'Consolas', 'Courier New', monospace;
}

.ml-log-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 18px;
    border-bottom: 0px solid var(--n-border);
    font-size: 12px;
}
.ml-log-row:last-child { border-bottom: none; }
.ml-log-row.ok i   { color: var(--n-success); }
.ml-log-row.fail i { color: var(--n-danger); }
.ml-log-email {
    flex: 1;
    min-width: 0;
    color: var(--n-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ml-log-camp {
    color: var(--n-muted);
    font-size: 11px;
    flex-shrink: 0;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ml-log-time {
    color: var(--n-muted);
    flex-shrink: 0;
    font-size: 11px;
    white-space: nowrap;
}

.ml-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.6);
    align-items: center;
    justify-content: center;
    display: flex;
}
.ml-modal {
    background: var(--n-surface);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    overflow: hidden;
}
.ml-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 0px solid var(--n-border);
    font-weight: 700;
    font-size: 14px;
    color: var(--n-text);
}
.ml-modal-head span { display: flex; align-items: center; gap: 8px; }

.ml-modal-head.head-blue   { border-bottom: 0px solid #4a6cf7; }
.ml-modal-head.head-blue i   { color: #4a6cf7; }
.ml-modal-head.head-green  { border-bottom: 0px solid #16a34a; }
.ml-modal-head.head-green i  { color: #16a34a; }
.ml-modal-head.head-purple { border-bottom: 0px solid #9333ea; }
.ml-modal-head.head-purple i { color: #9333ea; }
.ml-modal-head.head-orange { border-bottom: 0px solid #ea580c; }
.ml-modal-head.head-orange i { color: #ea580c; }
.ml-modal-head.head-red    { border-bottom: 0px solid #dc2626; }
.ml-modal-head.head-red i    { color: #dc2626; }

.alert {
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.alert-danger  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #b45309; border-color: #fed7aa; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
[data-theme="dark"] .alert-success { background: #14271a; color: #4ade80; border-color: #1f4a2f; }
[data-theme="dark"] .alert-danger  { background: #2a1414; color: #f87171; border-color: #4a1f1f; }
[data-theme="dark"] .alert-warning { background: #2a2114; color: #fbbf24; border-color: #4a3a1f; }
[data-theme="dark"] .alert-info    { background: #14202a; color: #60a5fa; border-color: #1f3a4a; }

@media (max-width: 991px) {
    .n-wrap { padding: 16px; }
    .ml-camp-meta, .ml-list-meta { gap: 5px; }
}
@media (max-width: 576px) {
    .n-topbar { padding: 10px 14px; flex-wrap: wrap; }
    .n-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .ml-camp-row, .ml-list-row { flex-direction: column; align-items: stretch; }
    .ml-row-actions { justify-content: flex-end; border-left: none; padding-left: 0; margin-left: 0; margin-top: 8px; }
}

.tpl-editor-wrap {
    border: 1px solid var(--n-border);
    border-radius: 9px;
    overflow: hidden;
    background: var(--n-surface);
}
.tpl-editor-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: var(--n-hover);
    border-bottom: 0px solid var(--n-border);
    user-select: none;
}
.tpl-editor-lang {
    font-size: 11px;
    font-weight: 700;
    color: var(--n-primary);
    text-transform: uppercase;
    letter-spacing: .6px;
}
.tpl-code-editor {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: 'Consolas', 'Courier New', monospace !important;
    font-size: 12.5px !important;
    line-height: 1.65 !important;
    resize: vertical;
    min-height: 240px;
    tab-size: 2;
}
.tpl-code-editor:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.ml-stats-section {
    padding: 14px 0;
    border-top: 1px solid var(--n-border);
}
.ml-stats-section:first-child { border-top: none; padding-top: 0; }
.ml-stats-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--n-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ml-success-bar-wrap { width: 100%; }
.ml-success-bar-track {
    height: 10px;
    background: var(--n-hover);
    border: 1px solid var(--n-border);
    border-radius: 99px;
    overflow: hidden;
}
.ml-success-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--n-success);
    transition: width .5s ease;
}

.ml-pagination-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 7px 14px;
    border-bottom: 0px solid var(--n-border);
    background: var(--n-hover);
    min-height: 38px;
    overflow-x: auto;
}
.ml-pagination-bar:empty { display: none; }

.ml-pag-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.ml-pag-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--n-muted);
    white-space: nowrap;
}

.ml-pag-info {
    font-size: 11px;
    font-weight: 500;
    color: var(--n-muted);
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}
.ml-pg-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.ml-pg-btn {
    min-width: 26px;
    height: 24px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid var(--n-border);
    border-radius: 5px;
    background: var(--n-surface);
    color: var(--n-sub);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s, border-color .12s;
}
.ml-pg-btn:hover:not(.active):not(.disabled) {
    border-color: var(--n-primary);
    color: var(--n-primary);
}
.ml-pg-btn.active {
    background: var(--n-primary);
    color: #fff;
    border-color: var(--n-primary);
    font-weight: 700;
    cursor: default;
}
.ml-pg-btn.disabled {
    opacity: .3;
    cursor: not-allowed;
}
.ml-pg-sep {
    font-size: 11px;
    color: var(--n-muted);
    padding: 0 2px;
    user-select: none;
}

@media (max-width: 600px) {
    .ml-pag-label { display: none; }
    .ml-pag-info  { margin-left: 0; }
    .ml-pagination-bar { flex-wrap: wrap; }
}

.ml-pp-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 3px 24px 3px 9px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid var(--n-border);
    border-radius: 6px;
    background: var(--n-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center;
    color: var(--n-text);
    cursor: pointer;
    line-height: 1.6;
    transition: border-color .12s, box-shadow .12s;
    min-width: 64px;
}
.ml-pp-select:focus {
    outline: none;
    border-color: var(--n-primary);
    box-shadow: 0 0 0 3px rgba(74,108,247,.12);
}
[data-theme="dark"] .ml-pp-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a0aec0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.ml-lp-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 0px solid var(--n-border);
    transition: background .1s;
}
.ml-lp-row:hover { background: var(--n-hover); }
.ml-lp-row:last-child { border-bottom: none; }
.ml-lp-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--n-muted);
    width: 28px;
    flex-shrink: 0;
    text-align: right;
}
.ml-lp-email {
    flex: 1;
    font-size: 13px;
    color: var(--n-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Consolas', 'Courier New', monospace;
}
.ml-lp-copy {
    opacity: 0;
    transition: opacity .15s;
    flex-shrink: 0;
}
.ml-lp-row:hover .ml-lp-copy { opacity: 1; }

.ml-list-chip-btn {
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.ml-list-chip-btn:hover {
    background: var(--n-primary) !important;
    border-color: var(--n-primary) !important;
    color: #fff !important;
}

.ml-camp-archived {
    opacity: .55;
}
.ml-camp-archived:hover {
    opacity: .8;
}
.ml-camp-archived .ml-camp-name,
.ml-camp-archived .ml-camp-subject {
    text-decoration: line-through;
    color: var(--n-muted);
}

#settingsToggleHead:hover {
    background: var(--n-hover);
}
#settingsBody .n-card-body {
    border-top: 1px solid var(--n-border);
}

.ml-multilist {
    border: 1px solid var(--n-border);
    border-radius: 8px;
    background: var(--n-surface);
    max-height: 160px;
    overflow-y: auto;
}
.ml-multilist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 0px solid var(--n-border);
    transition: background .1s;
    font-size: 13px;
    color: var(--n-text);
}
.ml-multilist-item:last-child { border-bottom: none; }
.ml-multilist-item:hover { background: var(--n-hover); }
.ml-multilist-cb { cursor: pointer; accent-color: var(--n-primary); width: 15px; height: 15px; flex-shrink: 0; }
.ml-multilist-label { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.ml-multilist-count {
    font-size: 11px;
    color: var(--n-muted);
    background: var(--n-hover);
    border: 1px solid var(--n-border);
    border-radius: 99px;
    padding: 1px 7px;
    flex-shrink: 0;
}
.ml-multilist-item:has(.ml-multilist-cb:checked) {
    background: rgba(74,108,247,.07);
}
.ml-multilist-item:has(.ml-multilist-cb:checked) .ml-multilist-count {
    background: rgba(74,108,247,.15);
    border-color: var(--n-primary);
    color: var(--n-primary);
}

/* ── Rozwijana lista wielokrotnego wyboru (odbiorcy kampanii) ────────────── */
.ml-dropdown-select {
    position: relative;
}
.ml-dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--n-border);
    border-radius: 8px;
    background: var(--n-surface);
    color: var(--n-text);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.ml-dropdown-trigger:hover { border-color: var(--n-primary); }
.ml-dropdown-select.open .ml-dropdown-trigger {
    border-color: var(--n-primary);
    box-shadow: 0 0 0 3px rgba(74,108,247,.12);
}
.ml-dropdown-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ml-dropdown-chevron {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--n-muted);
    transition: transform .15s;
}
.ml-dropdown-select.open .ml-dropdown-chevron { transform: rotate(180deg); }

.ml-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--n-surface);
    border: 1px solid var(--n-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
}
.ml-dropdown-select.open .ml-dropdown-panel { display: block; }

.ml-checklist {
    border: 1px solid var(--n-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--n-surface);
    max-height: 220px;
    overflow-y: auto;
}
.ml-dropdown-panel .ml-checklist {
    border: none;
    max-height: 240px;
}
.ml-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 0px solid var(--n-border);
    transition: background .1s;
    user-select: none;
}
.ml-checklist-item:last-child { border-bottom: none; }
.ml-checklist-item:hover { background: var(--n-hover); }
.ml-checklist-cb {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--n-primary);
    flex-shrink: 0;
}
.ml-checklist-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--n-muted);
    width: 18px;
    text-align: right;
    flex-shrink: 0;
}
.ml-checklist-name {
    flex: 1;
    font-size: 13px;
    color: var(--n-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ml-checklist-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--n-muted);
    background: var(--n-hover);
    border: 1px solid var(--n-border);
    border-radius: 99px;
    padding: 1px 8px;
    flex-shrink: 0;
}
.ml-checklist-item:has(.ml-checklist-cb:checked) {
    background: rgba(74,108,247,.07);
    border-left: 3px solid var(--n-primary);
    padding-left: 9px;
}
.ml-checklist-item:has(.ml-checklist-cb:checked) .ml-checklist-name {
    color: var(--n-primary);
    font-weight: 600;
}
.ml-checklist-item:has(.ml-checklist-cb:checked) .ml-checklist-badge {
    background: rgba(74,108,247,.15);
    border-color: var(--n-primary);
    color: var(--n-primary);
}

/* ── ZAPLANOWANE ── */
#scheduledFields {
    background: var(--n-hover);
    border: 1px solid var(--n-border);
    border-radius: 8px;
    padding: 14px 16px;
}
#scheduledFields .n-label {
    font-size: 11px;
}
#scheduledFields input[type="date"],
#scheduledFields input[type="time"] {
    font-size: 13px;
    padding: 8px 12px;
}

.ml-scheduled-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}
[data-theme="dark"] .ml-scheduled-badge {
    background: #2a2416;
    color: #fbbf24;
    border-color: #92400e;
}

.ml-scheduled-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 500;
    background: var(--n-hover);
    color: var(--n-primary);
    border: 1px solid var(--n-border);
}
.ml-scheduled-info i {
    font-size: 10px;
}
[data-theme="dark"] .ml-scheduled-info {
    background: #1a2a3a;
    border-color: #2d4a6e;
    color: #6c8cff;
}

/* ── STATUS WYSŁANEJ KAMPANII ZAPLANOWANEJ ── */
.ml-scheduled-info.sent {
    background: var(--n-success) !important;
    color: #fff !important;
    border-color: var(--n-success) !important;
}
.ml-scheduled-info.sent i {
    color: #fff !important;
}



/* ── ZAŁĄCZNIKI ── */
#attachmentsList {
    max-height: 150px;
    overflow-y: auto;
}
#attachmentsList .attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--n-hover);
    border: 1px solid var(--n-border);
    border-radius: 6px;
    margin-bottom: 5px;
}
#attachmentsList .attachment-item:last-child {
    margin-bottom: 0;
}
.attachment-item:hover {
    background: var(--n-border);
}
.attachment-icon {
    color: var(--n-primary);
    font-size: 18px;
    flex-shrink: 0;
}
.attachment-name {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: var(--n-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-size {
    font-size: 10px;
    color: var(--n-muted);
    flex-shrink: 0;
    white-space: nowrap;
}
.attachment-item .n-btn-danger-ghost {
    flex-shrink: 0;
    opacity: 0.5;
}
.attachment-item:hover .n-btn-danger-ghost {
    opacity: 1;
}






/* ===== STRONA LOGOWANIA ===== */

/* ===== RESET I STYLE GLOBALNE ===== */


body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: var(--bg-body);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    margin: 0;
}

/* ===== KARTA LOGOWANIA ===== */
.login-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px var(--shadow);
    max-width: 420px;
    width: 100%;
    overflow: hidden;
}

.login-card .card-body { 
    padding: 40px 35px; 
}

/* ===== IKONA I TYTUŁ ===== */
.login-icon { 
    font-size: 48px; 
    color: var(--primary); 
    display: block; 
    margin-bottom: 8px; 
}

.login-title { 
    color: var(--text-main); 
    font-weight: 700; 
    margin: 0 0 4px; 
    font-size: 22px;
}

.login-subtitle { 
    color: var(--text-muted); 
    font-size: 14px; 
    margin: 0; 
}

/* ===== FORMULARZ ===== */
.form-label { 
    color: var(--text-sub); 
    font-weight: 600; 
    margin-bottom: 5px;
    display: block;
    font-size: 14px;
}

.form-control {
    background: var(--bg-input) !important;
    border-color: var(--border) !important;
    color: var(--text-main) !important;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.18) !important;
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ===== PRZYCISK ZALOGUJ ===== */
.btn-primary-custom {
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    border: none;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary-custom:hover { 
    background: #6c8cff; 
    color: #fff;
}

.btn-primary-custom:active { 
    transform: scale(0.98); 
}

/* ===== ALERTY ===== */
.alert-danger {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

[data-theme="dark"] .alert-danger {
    background: #2d1a1a;
    border-color: #ef4444;
    color: #f87171;
}

/* ===== PRZEŁĄCZNIK MOTYWU ===== */
.theme-toggle { 
    transition: background 0.3s; 
    flex-shrink: 0;
}

.toggle-circle { 
    transition: left 0.3s ease; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== RESPONSYWNOŚĆ ===== */
@media (max-width: 576px) {
    .login-card .card-body { 
        padding: 30px 20px; 
    }
    
    .login-title { 
        font-size: 20px; 
    }
    
    .login-icon { 
        font-size: 40px; 
    }
}

/* ================================================================
   WSPÓLNE STYLE DLA PRZEŁĄCZNIKA (jeśli brakuje)
   ================================================================ */
.n-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: #e2e8f0;
    border-radius: 50px;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.n-toggle.active {
    background: #4a6cf7;
    border-color: #4a6cf7;
}

.n-toggle-knob {
    position: absolute;
    top: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: left 0.3s ease;
}

.n-toggle:not(.active) .n-toggle-knob {
    left: 2px;
}

.n-toggle.active .n-toggle-knob {
    left: 26px;
}

.n-toggle-knob i {
    transition: color 0.3s ease;
}

.n-toggle:not(.active) .n-toggle-knob i {
    color: #f59e0b;
}

.n-toggle.active .n-toggle-knob i {
    color: #6c8cff;
}




/* ===== NOTATKA POD PRZYCISKAMI AKCJI ===== */
.ml-camp-note-full {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(74, 108, 247, 0.06);
    border-left: 3px solid var(--n-primary);
    border-radius: 6px;
    font-size: 12px;
    color: var(--n-sub);
    line-height: 1.5;
    order: 10;
}

.ml-camp-note-full i {
    color: var(--n-primary);
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.ml-camp-note-full span {
    word-break: break-word;
}

/* Opcjonalnie: wersja z żółtym tłem */
.ml-camp-note-full.highlight {
    background: rgba(251, 191, 36, 0.12);
    border-left-color: var(--n-warning);
}

.ml-camp-note-full.highlight i {
    color: var(--n-warning);
}



