.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* =========================
   QuantumERP Mailer Campaigns UI
   Scoped classes to avoid conflicts with the main ERP theme
========================= */
:root {
    --q-mailer-primary: #022964;
    --q-mailer-primary-2: #06408f;
    --q-mailer-accent: #15a89e;
    --q-mailer-bg: #f4f7fb;
    --q-mailer-border: #e2e8f0;
    --q-mailer-text: #334155;
}

body {
    background: var(--q-mailer-bg);
    font-family: Cairo, "Segoe UI", Tahoma, Arial, sans-serif;
}

.mailer-page {
    min-height: 100vh;
    padding: 28px 16px 44px;
    background:
        radial-gradient(circle at top left, rgba(21, 168, 158, 0.10), transparent 32%),
        var(--q-mailer-bg);
    color: var(--q-mailer-text);
}

.mailer-shell {
    width: min(100%, 1240px);
    margin: 0 auto;
}

.mailer-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding: 24px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--q-mailer-primary), var(--q-mailer-primary-2));
    color: #fff;
    box-shadow: 0 18px 45px rgba(2, 41, 100, 0.18);
}

.mailer-hero h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 900;
    color: #fff;
}

.mailer-hero p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
}

.mailer-btn-primary {
    background: var(--q-mailer-accent) !important;
    border-color: var(--q-mailer-accent) !important;
    color: #fff !important;
    font-weight: 900;
    border-radius: 12px;
    box-shadow: 0 12px 26px rgba(21, 168, 158, 0.24);
}

.mailer-btn-primary:hover {
    background: #108f87 !important;
    border-color: #108f87 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.mailer-grid-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.mailer-kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 128px;
    padding: 22px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--q-mailer-border);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.mailer-kpi-card::after {
    content: "";
    position: absolute;
    inset-inline-end: -22px;
    bottom: -24px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(21, 168, 158, 0.10);
}

.mailer-kpi-card i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #eefdfb;
    color: var(--q-mailer-accent);
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.mailer-kpi-label {
    color: #64748b;
    font-weight: 800;
    margin-bottom: 6px;
}

.mailer-kpi-value {
    color: var(--q-mailer-primary);
    font-size: 1.65rem;
    font-weight: 900;
}

.mailer-card {
    background: #fff;
    border: 1px solid var(--q-mailer-border);
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.mailer-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 22px;
    background: #f8fafc;
    border-bottom: 1px solid var(--q-mailer-border);
}

.mailer-card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--q-mailer-primary);
    font-weight: 900;
}

.mailer-card-body {
    padding: 22px;
}

.mailer-table {
    margin: 0;
}

.mailer-table thead th {
    background: var(--q-mailer-primary) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    white-space: nowrap;
    font-weight: 900;
}

.mailer-table td {
    vertical-align: middle;
    font-weight: 650;
}

.mailer-code {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--q-mailer-primary);
    font-weight: 900;
    font-size: 0.85rem;
}

.mailer-empty {
    min-height: 160px;
    display: grid;
    place-items: center;
    gap: 8px;
    color: #64748b;
    font-weight: 900;
    text-align: center;
}

.mailer-empty i {
    font-size: 2.2rem;
    color: var(--q-mailer-accent);
}

.campaign-status,
.recipient-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 900;
    white-space: nowrap;
}

.campaign-status.status-Draft { background: #f1f5f9; color: #475569; }
.campaign-status.status-PendingApproval { background: #fff7ed; color: #c2410c; }
.campaign-status.status-Approved { background: #eff6ff; color: #1d4ed8; }
.campaign-status.status-Scheduled { background: #eef2ff; color: #4338ca; }
.campaign-status.status-Sending { background: #ecfeff; color: #0891b2; }
.campaign-status.status-Paused { background: #fef3c7; color: #b45309; }
.campaign-status.status-Completed { background: #ecfdf5; color: #047857; }
.campaign-status.status-Cancelled,
.campaign-status.status-Failed { background: #fef2f2; color: #b91c1c; }

.recipient-status { background: #f1f5f9; color: #475569; }
.recipient-status.status-Sent,
.recipient-status.status-Delivered,
.recipient-status.status-Opened,
.recipient-status.status-Clicked { background: #ecfdf5; color: #047857; }
.recipient-status.status-Failed,
.recipient-status.status-Bounced { background: #fef2f2; color: #b91c1c; }
.recipient-status.status-Retrying { background: #fff7ed; color: #c2410c; }
.recipient-status.status-Skipped,
.recipient-status.status-Unsubscribed { background: #f1f5f9; color: #64748b; }

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.wizard-step {
    border: 1px solid var(--q-mailer-border);
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
    color: var(--q-mailer-primary);
    font-weight: 900;
    text-align: center;
    cursor: pointer;
    transition: 0.22s ease;
}

.wizard-step.active,
.wizard-step:hover {
    background: linear-gradient(135deg, var(--q-mailer-primary), var(--q-mailer-primary-2));
    color: #fff;
    border-color: var(--q-mailer-primary);
}

.health-score-ring {
    --value: calc(var(--score) * 1%);
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--q-mailer-accent) var(--value), #e2e8f0 0);
    position: relative;
}

.health-score-ring::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: #fff;
}

.health-score-ring span {
    position: relative;
    color: var(--q-mailer-primary);
    font-weight: 900;
}

.preview-frame {
    min-height: 260px;
    padding: 20px;
    border: 1px solid var(--q-mailer-border);
    border-radius: 16px;
    background: #f8fafc;
    overflow: auto;
}

.code-textarea {
    direction: ltr;
    text-align: left;
    font-family: Consolas, "Courier New", monospace;
}

.recipient-preview,
.summary-box,
.mailer-insight {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--q-mailer-border);
    background: #f8fafc;
    font-weight: 800;
}

.mailer-insight.success { background: #ecfdf5; color: #047857; }
.mailer-insight.info { background: #eff6ff; color: #1d4ed8; }
.mailer-insight.warning { background: #fffbeb; color: #b45309; }

.mailer-check {
    padding: 12px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--q-mailer-border);
}

@media (max-width: 991.98px) {
    .mailer-page { padding: 18px 10px 30px; }
    .mailer-hero { flex-direction: column; align-items: stretch; text-align: center; }
    .mailer-grid-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wizard-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .mailer-grid-kpis,
    .wizard-steps { grid-template-columns: 1fr; }
    .mailer-card-body { padding: 16px; }
    .mailer-card-header { padding: 16px; }
}

/* =========================
   QuantumERP Mailer Login + Main Layout
   Scoped classes to avoid ERP theme conflicts
========================= */
.mailer-main-layout {
    min-height: 100vh;
    background: var(--q-mailer-bg, #f4f7fb);
}

.mailer-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 68px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mailer-brand {
    color: #022964;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.mailer-brand:hover {
    color: #022964;
}

.mailer-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #022964, #15a89e);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 12px 24px rgba(21, 168, 158, 0.22);
}

.mailer-brand strong,
.mailer-brand small {
    display: block;
    line-height: 1.2;
}

.mailer-brand strong {
    font-size: 1rem;
    font-weight: 900;
}

.mailer-brand small {
    margin-top: 4px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.mailer-topbar-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 auto;
    overflow-x: auto;
    padding: 4px;
}

.mailer-topbar-links a {
    color: #334155;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    transition: 0.22s ease;
}

.mailer-topbar-links a:hover {
    background: #eefdfb;
    color: #15a89e;
}

.mailer-user-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.mailer-user-name {
    color: #022964;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mailer-logout-btn {
    border: 0;
    border-radius: 12px;
    min-height: 40px;
    padding: 8px 14px;
    background: #022964;
    color: #fff;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: 0.22s ease;
}

.mailer-logout-btn:hover {
    background: #011f4d;
    transform: translateY(-1px);
}

.qmail-login-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 18%, rgba(21, 168, 158, 0.20), transparent 30%),
        radial-gradient(circle at 88% 82%, rgba(2, 41, 100, 0.18), transparent 28%),
        linear-gradient(135deg, #f8fafc, #eef6f8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 14px;
    color: #334155;
}

.qmail-login-bg-shape {
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    opacity: 0.85;
    pointer-events: none;
}

.qmail-login-bg-shape.shape-1 {
    width: 360px;
    height: 360px;
    top: -120px;
    right: -120px;
    background: rgba(21, 168, 158, 0.16);
}

.qmail-login-bg-shape.shape-2 {
    width: 420px;
    height: 420px;
    bottom: -160px;
    left: -150px;
    background: rgba(2, 41, 100, 0.14);
}

.qmail-login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 500px);
    padding: 30px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.92);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.13);
    backdrop-filter: blur(18px);
}

.qmail-login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
}

.qmail-login-logo {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    background: linear-gradient(135deg, #022964, #15a89e);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    box-shadow: 0 16px 34px rgba(21, 168, 158, 0.26);
}

.qmail-login-brand h1 {
    margin: 0;
    color: #022964;
    font-size: 1.45rem;
    font-weight: 950;
}

.qmail-login-brand p {
    margin: 7px 0 0;
    color: #64748b;
    font-weight: 700;
}

.qmail-login-alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 16px;
    font-weight: 800;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    line-height: 1.7;
}

.qmail-login-alert.danger {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.qmail-login-alert.success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.qmail-login-field {
    margin-bottom: 16px;
}

.qmail-login-field label {
    display: block;
    margin-bottom: 8px;
    color: #022964;
    font-weight: 900;
}

.qmail-input-wrap {
    position: relative;
}

.qmail-input-wrap > i {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: #15a89e;
    font-size: 1.05rem;
    z-index: 2;
}

.qmail-input-wrap .form-control {
    height: 52px;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    padding-right: 44px;
    padding-left: 48px;
    color: #334155;
    font-weight: 800;
    box-shadow: none;
    background: #ffffff;
}

.qmail-input-wrap .form-control:focus {
    border-color: #15a89e;
    box-shadow: 0 0 0 0.22rem rgba(21, 168, 158, 0.12);
}

.qmail-password-toggle {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
    color: #022964;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.qmail-password-toggle:hover {
    background: #eefdfb;
    color: #15a89e;
}

.qmail-login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 6px 0 20px;
}

.qmail-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-weight: 800;
    cursor: pointer;
}

.qmail-remember input {
    width: 18px;
    height: 18px;
    accent-color: #15a89e;
}

.qmail-login-submit {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #022964, #15a89e);
    color: #ffffff;
    font-size: 1.03rem;
    font-weight: 950;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 18px 36px rgba(2, 41, 100, 0.20);
    transition: 0.24s ease;
}

.qmail-login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(2, 41, 100, 0.26);
}

.qmail-login-submit:disabled {
    cursor: wait;
    opacity: 0.78;
}

.qmail-login-note {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.7;
    display: flex;
    gap: 8px;
}

.qmail-login-note i {
    color: #15a89e;
    margin-top: 3px;
}

@media (max-width: 991.98px) {
    .mailer-topbar {
        position: relative;
        flex-direction: column;
        align-items: stretch;
    }

    .mailer-topbar-links {
        justify-content: flex-start;
    }

    .mailer-user-box {
        justify-content: space-between;
    }
}

@media (max-width: 575.98px) {
    .qmail-login-card {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .qmail-login-brand {
        align-items: flex-start;
    }

    .qmail-login-logo {
        width: 54px;
        height: 54px;
        border-radius: 18px;
        font-size: 1.55rem;
    }

    .qmail-login-brand h1 {
        font-size: 1.2rem;
    }

    .qmail-login-brand p {
        font-size: 0.88rem;
    }
}

/* =========================
   QuantumERP Mailer Login + Protected Layout
========================= */
.q-layout-loading {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--q-mailer-primary);
    font-weight: 900;
    background: var(--q-mailer-bg);
}

.q-mailer-layout {
    min-height: 100vh;
    background: var(--q-mailer-bg);
}

.q-mailer-topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    min-height: 72px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
}

.q-mailer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--q-mailer-primary);
    font-weight: 950;
    white-space: nowrap;
}

.q-mailer-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--q-mailer-primary), var(--q-mailer-primary-2));
    color: #fff;
    box-shadow: 0 10px 24px rgba(2, 41, 100, 0.22);
}

.q-mailer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
    padding: 4px;
}

.q-mailer-nav a {
    min-height: 42px;
    padding: 9px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
    transition: 0.22s ease;
}

.q-mailer-nav a:hover,
.q-mailer-nav a.active {
    background: #eefdfb;
    color: var(--q-mailer-accent);
}

.q-mailer-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.q-mailer-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
}

.q-mailer-user-info strong {
    color: var(--q-mailer-primary);
    font-size: 0.92rem;
}

.q-mailer-user-info small {
    color: #64748b;
    font-weight: 700;
}

.q-mailer-logout {
    min-height: 40px;
    border: 0;
    border-radius: 12px;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 900;
    transition: 0.22s ease;
}

.q-mailer-logout:hover {
    background: #dc2626;
    color: #fff;
}

.q-mailer-layout-body .mailer-page {
    padding-top: 24px;
}

.q-login-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        radial-gradient(circle at 10% 10%, rgba(21, 168, 158, 0.18), transparent 28%),
        radial-gradient(circle at 90% 18%, rgba(2, 41, 100, 0.16), transparent 30%),
        linear-gradient(135deg, #f8fafc, #eef4fb);
}

.q-login-bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    pointer-events: none;
}

.q-login-bg-shape.shape-one {
    width: 280px;
    height: 280px;
    inset-inline-start: -90px;
    bottom: -80px;
    background: rgba(21, 168, 158, 0.14);
}

.q-login-bg-shape.shape-two {
    width: 220px;
    height: 220px;
    inset-inline-end: -70px;
    top: -60px;
    background: rgba(2, 41, 100, 0.12);
}

.q-login-wrapper {
    position: relative;
    z-index: 2;
    width: min(100%, 1080px);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    border-radius: 30px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
}

.q-login-brand-panel {
    min-height: 620px;
    padding: 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(2, 41, 100, 0.95), rgba(6, 64, 143, 0.92)),
        radial-gradient(circle at 20% 15%, rgba(21, 168, 158, 0.38), transparent 24%);
    color: #fff;
}

.q-login-logo {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.16);
}

.q-login-logo i {
    font-size: 2.2rem;
    color: #fff;
}

.q-login-brand-panel h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 3vw, 3.2rem);
    font-weight: 950;
}

.q-login-brand-panel p {
    margin: 18px 0 0;
    max-width: 520px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.9;
    font-weight: 700;
}

.q-login-features {
    display: grid;
    gap: 12px;
    margin-top: 34px;
}

.q-login-features span {
    width: fit-content;
    padding: 11px 14px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 900;
}

.q-login-features i {
    color: #67e8f9;
}

.q-login-card {
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}

.q-login-card-header {
    margin-bottom: 24px;
}

.q-login-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #eefdfb;
    color: var(--q-mailer-accent);
    font-weight: 950;
    margin-bottom: 14px;
}

.q-login-card h2 {
    margin: 0;
    color: var(--q-mailer-primary);
    font-size: 2rem;
    font-weight: 950;
}

.q-login-card p {
    margin: 10px 0 0;
    color: #64748b;
    font-weight: 700;
}

.q-login-alert {
    border-radius: 14px;
    font-weight: 800;
}

.q-login-field {
    margin-bottom: 16px;
}

.q-login-field label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 950;
}

.q-input-icon {
    position: relative;
}

.q-input-icon > i {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--q-mailer-accent);
    font-size: 1.1rem;
    z-index: 2;
}

.q-input-icon .form-control {
    min-height: 52px;
    padding-inline-start: 44px;
    padding-inline-end: 44px;
    border-radius: 16px;
    border: 1px solid #dbe4ef;
    background: #f8fafc;
    font-weight: 850;
    box-shadow: none;
}

.q-input-icon .form-control:focus {
    border-color: var(--q-mailer-accent);
    background: #fff;
    box-shadow: 0 0 0 0.2rem rgba(21, 168, 158, 0.12);
}

.q-password-toggle {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.q-password-toggle:hover {
    background: #eefdfb;
    color: var(--q-mailer-accent);
}

.q-login-submit {
    width: 100%;
    min-height: 54px;
    margin-top: 8px;
    border: 0;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: linear-gradient(135deg, var(--q-mailer-primary), var(--q-mailer-primary-2));
    color: #fff;
    font-weight: 950;
    box-shadow: 0 16px 34px rgba(2, 41, 100, 0.22);
    transition: 0.22s ease;
}

.q-login-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(2, 41, 100, 0.28);
}

.q-login-submit:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.q-login-footer-note {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 800;
    line-height: 1.7;
}

.q-login-footer-note code {
    color: #b45309;
    font-weight: 950;
}

.q-login-page .validation-message {
    margin-top: 6px;
    color: #dc2626;
    font-weight: 800;
    font-size: 0.88rem;
}

@media (max-width: 991.98px) {
    .q-mailer-topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .q-mailer-nav {
        justify-content: flex-start;
    }

    .q-mailer-user {
        justify-content: space-between;
    }

    .q-login-wrapper {
        grid-template-columns: 1fr;
    }

    .q-login-brand-panel {
        min-height: auto;
        padding: 32px;
    }

    .q-login-card {
        padding: 32px;
    }
}

@media (max-width: 575.98px) {
    .q-login-page {
        padding: 12px;
    }

    .q-login-wrapper {
        border-radius: 22px;
    }

    .q-login-brand-panel,
    .q-login-card {
        padding: 24px 18px;
    }

    .q-login-card h2 {
        font-size: 1.6rem;
    }

    .q-mailer-user {
        flex-direction: column;
        align-items: stretch;
    }

    .q-mailer-logout {
        justify-content: center;
        width: 100%;
    }
}

/* =========================
   Mailer library: templates and mailing lists
========================= */
.library-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.library-list-item {
    width: 100%;
    border: 1px solid var(--q-mailer-border);
    background: #ffffff;
    border-radius: 14px;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: start;
    color: var(--q-mailer-text);
    transition: 0.22s ease;
}

.library-list-item:hover,
.library-list-item.active {
    border-color: rgba(21, 168, 158, 0.45);
    background: #eefdfb;
    transform: translateY(-1px);
}

.library-list-item strong {
    display: block;
    color: var(--q-mailer-primary);
    font-weight: 900;
}

.library-list-item small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 700;
}

.library-select-card {
    min-height: 150px;
    border: 1px solid var(--q-mailer-border);
    border-radius: 18px;
    background: #ffffff;
    padding: 16px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    transition: 0.22s ease;
}

.library-select-card:hover,
.library-select-card.selected {
    border-color: rgba(21, 168, 158, 0.50);
    box-shadow: 0 16px 32px rgba(21, 168, 158, 0.12);
    transform: translateY(-2px);
}

.library-select-card.selected {
    background: linear-gradient(180deg, #ffffff, #eefdfb);
}

.library-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--q-mailer-primary);
    font-weight: 900;
}

.library-card-desc {
    margin-top: 8px;
    color: #64748b;
    font-weight: 700;
    line-height: 1.7;
}

.library-dot {
    width: 14px;
    height: 14px;
    min-width: 14px;
    border-radius: 50%;
    display: inline-flex;
    box-shadow: 0 0 0 4px rgba(21, 168, 158, 0.10);
}

.library-card-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #475569;
    font-weight: 800;
}

.form-control-color {
    min-height: 42px;
}
