:root {
    --af-primary: var(--brand-primary, #dc2626);
    --af-primary-rgb: var(--brand-primary-rgb, 220, 38, 38);
    --af-dark: #111827;
    --af-muted: #64748b;
    --af-bg: #f4f6fa;
    --af-surface: #ffffff;
    --af-border: #e2e8f0;
    --af-soft: #f8fafc;
    --af-success: #15803d;
    --af-warning: #b45309;
    --af-danger: #b91c1c;
    --af-radius: 16px;
    --af-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.admin-main { padding: 20px; }
.premium-topbar { height: 66px; }
.premium-page-title { font-size: 1.18rem; }

.af-page {
    width: min(1480px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 16px;
    color: var(--af-dark);
}

.af-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border: 1px solid var(--af-border);
    border-radius: var(--af-radius);
    background: var(--af-surface);
    box-shadow: var(--af-shadow);
}

.af-heading-main { display: flex; gap: 14px; min-width: 0; }
.af-heading-icon {
    width: 44px; height: 44px; flex: 0 0 44px;
    display: grid; place-items: center;
    border-radius: 13px;
    background: rgba(var(--af-primary-rgb), .1);
    color: var(--af-primary);
    font-size: 18px;
}
.af-eyebrow {
    margin: 1px 0 3px;
    color: var(--af-primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.af-heading h1 { margin: 0; font-size: clamp(22px, 2.2vw, 29px); line-height: 1.15; font-weight: 900; }
.af-heading p { max-width: 780px; margin: 6px 0 0; color: var(--af-muted); font-size: 13px; line-height: 1.5; }
.af-heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.af-btn {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: #fff;
    color: var(--af-dark);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: .16s ease;
}
.af-btn:hover { transform: translateY(-1px); }
.af-btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.af-btn-primary { color: #fff; background: var(--af-primary); box-shadow: 0 7px 16px rgba(var(--af-primary-rgb), .18); }
.af-btn-primary:hover { filter: brightness(.93); }
.af-btn-secondary { border-color: var(--af-border); background: #fff; }
.af-btn-secondary:hover { border-color: rgba(var(--af-primary-rgb), .4); color: var(--af-primary); }
.af-btn-success { color: #fff; background: #15803d; }
.af-btn-danger { color: var(--af-danger); border-color: #fecaca; background: #fff; }
.af-btn-danger:hover { background: #fef2f2; }
.af-btn-warning { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.af-btn-icon { width: 35px; min-width: 35px; min-height: 35px; padding: 0; }

.af-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.af-stat {
    display: flex; align-items: center; gap: 12px;
    min-width: 0; padding: 14px 15px;
    border: 1px solid var(--af-border);
    border-radius: 14px;
    background: var(--af-surface);
    box-shadow: var(--af-shadow);
}
.af-stat-icon {
    width: 40px; height: 40px; flex: 0 0 40px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: rgba(var(--af-primary-rgb), .1);
    color: var(--af-primary);
}
.af-stat-label { margin: 0 0 2px; color: var(--af-muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.af-stat-value { margin: 0; font-size: 21px; line-height: 1.1; font-weight: 900; }
.af-stat-note { margin-top: 2px; color: var(--af-muted); font-size: 11px; }

.af-panel {
    border: 1px solid var(--af-border);
    border-radius: var(--af-radius);
    background: var(--af-surface);
    box-shadow: var(--af-shadow);
    overflow: hidden;
}
.af-panel-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 15px;
    padding: 15px 18px; border-bottom: 1px solid var(--af-border);
}
.af-panel-title { display: flex; gap: 10px; }
.af-panel-title-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(var(--af-primary-rgb), .09); color: var(--af-primary); }
.af-panel h2, .af-panel h3 { margin: 0; font-weight: 900; }
.af-panel h2 { font-size: 17px; }
.af-panel h3 { font-size: 15px; }
.af-panel-head p { margin: 3px 0 0; color: var(--af-muted); font-size: 12px; line-height: 1.45; }
.af-panel-body { padding: 16px 18px; }

.af-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1.55fr) repeat(2, minmax(150px, .72fr)) minmax(130px, .55fr) auto;
    gap: 11px;
    align-items: end;
    padding: 15px 18px;
    border-bottom: 1px solid var(--af-border);
    background: var(--af-soft);
}
.af-toolbar.compact-3 { grid-template-columns: minmax(240px, 1.8fr) minmax(150px, .7fr) minmax(130px, .55fr) auto; }
.af-field { min-width: 0; }
.af-label { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; color: #475569; font-size: 12px; font-weight: 800; }
.af-label i { color: var(--af-primary); }
.af-control {
    width: 100%; min-height: 40px;
    padding: 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: var(--af-dark);
    font-size: 13px;
    outline: none;
    transition: .15s ease;
}
.af-control:focus { border-color: var(--af-primary); box-shadow: 0 0 0 3px rgba(var(--af-primary-rgb), .1); }
textarea.af-control { min-height: 95px; resize: vertical; }
.af-help { display: block; margin-top: 5px; color: var(--af-muted); font-size: 11px; line-height: 1.4; }
.af-toolbar-actions { display: flex; align-items: center; gap: 8px; }

.af-list-meta {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--af-border);
    background: #fff;
    color: var(--af-muted);
    font-size: 12px;
}
.af-list-meta strong { color: var(--af-dark); }
.af-table-wrap { overflow-x: auto; }
.af-table { width: 100%; min-width: 920px; border-collapse: collapse; }
.af-table th {
    padding: 11px 13px;
    border-bottom: 1px solid #cbd5e1;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
    white-space: nowrap;
}
.af-table td { padding: 12px 13px; border-bottom: 1px solid #edf2f7; vertical-align: middle; font-size: 13px; }
.af-table tbody tr:nth-child(even) { background: #fbfcfe; }
.af-table tbody tr:hover { background: #fff7f7; }
.af-row-title { display: block; font-weight: 850; color: var(--af-dark); }
.af-row-sub { display: block; margin-top: 3px; color: var(--af-muted); font-size: 11px; }
.af-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.af-code { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--af-border); border-radius: 8px; background: #f8fafc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.af-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.af-badge-success { background: #dcfce7; color: #166534; }
.af-badge-warning { background: #fef3c7; color: #92400e; }
.af-badge-danger { background: #fee2e2; color: #991b1b; }
.af-badge-neutral { background: #e2e8f0; color: #475569; }
.af-empty { padding: 42px 20px; text-align: center; color: var(--af-muted); }
.af-empty i { display: block; margin-bottom: 8px; color: var(--af-primary); font-size: 26px; }

.af-pagination-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 13px 18px;
    border-top: 1px solid var(--af-border);
    background: #fff;
}
.af-pagination-summary { color: var(--af-muted); font-size: 12px; }
.af-pagination { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.af-page-btn {
    min-width: 33px; height: 33px; padding: 0 9px;
    display: inline-grid; place-items: center;
    border: 1px solid #cbd5e1; border-radius: 9px; background: #fff;
    color: var(--af-dark); font-size: 12px; font-weight: 800; cursor: pointer;
}
.af-page-btn.active { border-color: var(--af-primary); background: var(--af-primary); color: #fff; }
.af-page-btn:disabled { opacity: .4; cursor: not-allowed; }

.af-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 12px; line-height: 1.45; }
.af-alert-info { border: 1px solid #bfdbfe; background: #eff6ff; color: #1e40af; }
.af-alert-warning { border: 1px solid #fde68a; background: #fffbeb; color: #92400e; }
.af-alert-danger { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.af-alert-success { border: 1px solid #bbf7d0; background: #f0fdf4; color: #166534; }

.af-modal-backdrop {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(4px);
}
.af-modal-backdrop.is-open { display: flex; }
.af-modal {
    width: min(720px, 100%); max-height: 91vh;
    display: flex; flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--af-border); border-radius: 17px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15,23,42,.28);
}
.af-modal-sm { width: min(520px, 100%); }
.af-modal-lg { width: min(900px, 100%); }
.af-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; padding: 16px 18px; border-bottom: 1px solid var(--af-border); }
.af-modal-title { display: flex; gap: 11px; }
.af-modal-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(var(--af-primary-rgb), .1); color: var(--af-primary); }
.af-modal-head h2, .af-modal-head h3 { margin: 0; font-size: 18px; font-weight: 900; }
.af-modal-head p { margin: 4px 0 0; color: var(--af-muted); font-size: 12px; line-height: 1.4; }
.af-modal-close { width: 34px; height: 34px; border: 1px solid var(--af-border); border-radius: 9px; background: #fff; color: #64748b; cursor: pointer; }
.af-modal-body { padding: 17px 18px; overflow-y: auto; }
.af-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--af-border); background: var(--af-soft); }
.af-guide { display: flex; gap: 9px; margin-bottom: 15px; padding: 11px 12px; border: 1px solid #fecaca; border-radius: 11px; background: #fff7f7; color: #7f1d1d; font-size: 12px; line-height: 1.45; }
.af-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.af-form-grid .full { grid-column: 1 / -1; }
.af-field-error { margin-top: 5px; color: var(--af-danger); font-size: 11px; font-weight: 700; }
.af-form-section { margin-top: 14px; padding: 13px; border: 1px solid var(--af-border); border-radius: 12px; background: var(--af-soft); }
.af-form-section-title { margin: 0 0 10px; font-size: 13px; font-weight: 900; }
.af-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; max-height: 230px; overflow-y: auto; }
.af-check-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; padding: 9px; border: 1px solid var(--af-border); border-radius: 10px; background: #fff; }
.af-check-main { display: flex; gap: 8px; align-items: flex-start; }

.af-report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.af-report-card { border: 1px solid var(--af-border); border-radius: 14px; background: #fff; overflow: hidden; }
.af-report-card-head { padding: 13px 15px; border-bottom: 1px solid var(--af-border); }
.af-report-card-head h3 { margin: 0; font-size: 15px; font-weight: 900; }
.af-report-card-head p { margin: 3px 0 0; color: var(--af-muted); font-size: 11px; }
.af-report-card-body { padding: 14px 15px; }
.af-progress { height: 7px; border-radius: 999px; overflow: hidden; background: #e2e8f0; }
.af-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--af-primary), #111827); }

body.af-modal-open { overflow: hidden; }

@media (max-width: 1100px) {
    .af-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .af-toolbar, .af-toolbar.compact-3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .af-toolbar-actions { align-self: end; }
}
@media (max-width: 720px) {
    .admin-main { padding: 12px; }
    .af-heading { flex-direction: column; padding: 15px; }
    .af-heading-actions, .af-heading-actions .af-btn { width: 100%; }
    .af-stats, .af-toolbar, .af-toolbar.compact-3, .af-form-grid, .af-report-grid { grid-template-columns: 1fr; }
    .af-toolbar-actions { width: 100%; }
    .af-toolbar-actions .af-btn { flex: 1; }
    .af-pagination-bar, .af-list-meta { align-items: flex-start; flex-direction: column; }
    .af-modal-backdrop { padding: 0; align-items: flex-end; }
    .af-modal { width: 100%; max-height: 95vh; border-radius: 17px 17px 0 0; }
    .af-modal-footer .af-btn { flex: 1; }
    .af-check-grid { grid-template-columns: 1fr; }
}

/* Ajustes operativos 2026-07: dashboard, modales y acciones masivas */
.dashboard-five-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.af-modal > form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.af-modal > form > .af-modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.af-provider-preset {
    margin-top: 2px;
    padding: 13px;
    border: 1px solid var(--af-border);
    border-radius: 12px;
    background: var(--af-soft);
}
.af-provider-preset.is-automatic {
    border-color: #bfdbfe;
    background: #eff6ff;
}
.af-provider-preset .af-control[readonly] {
    background: #eef2f7;
    color: #475569;
    cursor: not-allowed;
}
.af-provider-guide-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.af-subject-groups {
    display: grid;
    gap: 12px;
    max-height: 330px;
    overflow-y: auto;
    padding-right: 4px;
}
.af-subject-group {
    border: 1px solid var(--af-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.af-subject-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border-bottom: 1px solid var(--af-border);
    background: #f8fafc;
    font-size: 12px;
    font-weight: 900;
    color: #334155;
}
.af-subject-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
}

.af-visibility-switch {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.af-visibility-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.af-visibility-switch__status {
    min-width: 96px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff1f2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 900;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.af-visibility-switch:not(.is-disabled):hover .af-visibility-switch__status {
    transform: translateY(-1px);
}
.af-visibility-switch.is-public .af-visibility-switch__status {
    border-color: #86efac;
    background: #ecfdf5;
    color: #15803d;
}
.af-visibility-switch.is-disabled {
    cursor: not-allowed;
}
.af-visibility-switch.is-disabled .af-visibility-switch__status {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    opacity: .8;
    transform: none;
}
.af-visibility-switch input:focus-visible + .af-visibility-switch__status {
    outline: 3px solid rgba(var(--af-primary-rgb), .16);
    outline-offset: 2px;
}

.af-actions-center {
    justify-content: center;
}
.af-text-center {
    text-align: center !important;
}

.af-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--af-border);
    background: #fff;
}
.af-bulk-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.af-selected-counter {
    display: inline-flex;
    align-items: center;
    min-height: 35px;
    padding: 0 10px;
    border-radius: 9px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.af-whatsapp-btn {
    color: #fff;
    background: #16a34a;
    border-color: #16a34a;
}
.af-whatsapp-btn:hover {
    filter: brightness(.94);
}
.af-whatsapp-btn:disabled,
.af-whatsapp-btn.is-disabled {
    color: #94a3b8;
    background: #f1f5f9;
    border-color: #e2e8f0;
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}
.af-status-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.af-status-detail {
    color: var(--af-muted);
    font-size: 11px;
}

.af-renewal-toolbar {
    grid-template-columns: minmax(220px, 1.35fr) minmax(145px, .65fr) minmax(150px, .75fr) minmax(155px, .8fr) minmax(125px, .55fr) auto;
}

@media (max-width: 1260px) {
    .dashboard-five-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .af-renewal-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .dashboard-five-stats,
    .af-renewal-toolbar,
    .af-subject-group-grid { grid-template-columns: 1fr; }
    .af-bulk-bar { align-items: stretch; flex-direction: column; }
    .af-bulk-controls { align-items: stretch; }
    .af-bulk-controls .af-control,
    .af-bulk-controls .af-btn { width: 100% !important; }
    .af-provider-guide-links .af-btn { width: 100%; }
}

@media (min-width: 901px) {
    .dashboard-five-stats {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
    .dashboard-five-stats .af-stat {
        padding-left: 12px;
        padding-right: 12px;
        gap: 9px;
    }
    .dashboard-five-stats .af-stat-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
    .dashboard-five-stats .af-stat-value {
        font-size: 19px;
    }
}


/* =========================================================
   Parche operativo: buzones, privacidad y acciones con color
   ========================================================= */

/* Buzones: modal compacto para Gmail y correo de dominio/cPanel. */
.af-mailbox-modal {
    width: min(690px, 94vw);
    max-height: 88vh;
}
.af-mailbox-modal .af-modal-body {
    gap: 13px;
    padding: 16px 18px;
}
.af-mailbox-modal .af-guide,
.af-mailbox-modal .af-alert {
    margin: 0;
}
.af-mailbox-credentials,
.af-mailbox-meta {
    gap: 11px;
}
.af-mailbox-provider-guide {
    padding: 11px 13px;
}
.af-provider-preset-head,
.af-domain-subjects-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.af-mailbox-server-grid {
    grid-template-columns: minmax(0, 1fr) 120px 150px;
    gap: 9px;
}
.af-mailbox-server-grid .full {
    grid-column: auto;
}
.af-mailbox-modal code {
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(15, 23, 42, .08);
    color: inherit;
    font-size: 11px;
    font-weight: 800;
}

/* Dominios: asuntos más compactos y selector rojo/verde visible. */
.af-domain-subjects {
    padding: 11px;
}
.af-domain-subjects .af-subject-groups {
    max-height: 292px;
    gap: 8px;
}
.af-domain-subjects .af-subject-group {
    border-radius: 10px;
}
.af-domain-subjects .af-subject-group-title {
    padding: 7px 9px;
    font-size: 11px;
}
.af-domain-subjects .af-subject-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
}
.af-domain-subjects .af-check-item {
    min-width: 0;
    min-height: 48px;
    align-items: center;
    gap: 7px;
    padding: 6px 7px;
    border-radius: 9px;
}
.af-domain-subjects .af-check-main {
    min-width: 0;
    flex: 1 1 auto;
    align-items: flex-start;
    gap: 6px;
}
.af-domain-subjects .af-check-main strong {
    display: -webkit-box;
    overflow: hidden;
    color: #1e293b;
    font-size: 11px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.af-domain-subjects .af-check-main input {
    flex: 0 0 auto;
    margin-top: 2px;
}
.af-domain-subjects .af-visibility-switch__status {
    min-width: 83px;
    min-height: 27px;
    gap: 5px;
    padding: 4px 8px 4px 6px;
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, .18);
    font-size: 10px;
}
.af-domain-subjects .af-visibility-switch__dot {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .24);
}
.af-domain-subjects .af-visibility-switch.is-public .af-visibility-switch__status {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
    box-shadow: 0 2px 6px rgba(22, 163, 74, .18);
}
.af-domain-subjects .af-visibility-switch.is-disabled .af-visibility-switch__status {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: #64748b;
    box-shadow: none;
}
.af-domain-subjects .af-visibility-switch.is-disabled .af-visibility-switch__dot {
    background: #f8fafc;
}

/* Paleta global para iconos de acciones. Se aplica en todos los módulos
   que usan la estructura .af-actions + .af-btn-icon. */
.af-actions .af-btn-icon,
.af-btn-icon.af-action-edit,
.af-btn-icon.af-action-whatsapp,
.af-btn-icon.af-action-list,
.af-btn-icon.af-action-renew,
.af-btn-icon.af-action-delete {
    border-width: 1px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
}
.af-actions .af-btn-icon[title*="Editar"],
.af-btn-icon.af-action-edit {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
}
.af-actions .af-btn-icon[title*="WhatsApp"],
.af-actions .af-btn-icon[title*="Notificar"],
.af-actions .af-btn-icon[title*="Enviar"],
.af-btn-icon.af-action-whatsapp {
    border-color: #86efac;
    background: #16a34a;
    color: #fff;
}
.af-actions .af-btn-icon[title*="lista"],
.af-actions .af-btn-icon[title*="Lista"],
.af-actions .af-btn-icon[title*="accesos"],
.af-btn-icon.af-action-list {
    border-color: #a5f3fc;
    background: #ecfeff;
    color: #0e7490;
}
.af-actions .af-btn-icon[title*="Renovar"],
.af-actions .af-btn-icon[title*="Regenerar"],
.af-btn-icon.af-action-renew {
    border-color: #fde68a;
    background: #fffbeb;
    color: #b45309;
}
.af-actions .af-btn-icon[title*="Eliminar"],
.af-btn-icon.af-action-delete {
    border-color: #fecaca;
    background: #dc2626;
    color: #fff;
}
.af-actions .af-btn-icon[title*="Copiar"] {
    border-color: #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}
.af-actions .af-btn-icon[title*="Ver"],
.af-actions .af-btn-icon[title*="Detalle"],
.af-actions .af-btn-icon[title*="Historial"] {
    border-color: #bae6fd;
    background: #f0f9ff;
    color: #0369a1;
}
.af-actions .af-btn-icon:hover {
    filter: brightness(.96);
    transform: translateY(-1px);
}

@media (max-width: 900px) {
    .af-domain-subjects .af-subject-group-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    .af-mailbox-modal {
        width: min(96vw, 690px);
    }
    .af-mailbox-server-grid,
    .af-domain-subjects .af-subject-group-grid {
        grid-template-columns: 1fr;
    }
    .af-provider-preset-head,
    .af-domain-subjects-head {
        align-items: stretch;
        flex-direction: column;
    }
}


/* Manual con el mismo ancho de los demás módulos (af-page: 1480px). */
.af-manual-page {
    align-content: start;
}

.af-manual-hero {
    background:
        radial-gradient(circle at 88% 10%, rgba(var(--af-primary-rgb), .12), transparent 28%),
        #fff;
}

.af-manual-search-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.af-manual-search-field {
    flex: 1;
    max-width: 780px;
}

.af-manual-version {
    min-width: 270px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    background: #f0fdf4;
    color: #166534;
}

.af-manual-version > i { font-size: 20px; }
.af-manual-version strong,
.af-manual-version span { display: block; }
.af-manual-version strong { font-size: 13px; }
.af-manual-version span { margin-top: 2px; font-size: 11px; color: #15803d; }

.af-manual-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--af-border);
    border-radius: var(--af-radius);
    background: #fff;
    box-shadow: var(--af-shadow);
}

.af-manual-nav a {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.af-manual-nav a:hover {
    border-color: rgba(var(--af-primary-rgb), .35);
    background: rgba(var(--af-primary-rgb), .06);
    color: var(--af-primary);
}

.af-manual-nav i { width: 17px; text-align: center; color: var(--af-primary); }
.af-manual-section { scroll-margin-top: 86px; }
.af-manual-content { display: grid; gap: 15px; }
.af-manual-content > h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 7px 0 0;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
}
.af-manual-content > h3 i { color: var(--af-primary); }
.af-manual-content > p { margin: 0; color: #475569; font-size: 13px; line-height: 1.65; }

.af-manual-steps {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.af-manual-steps--flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.af-manual-steps li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--af-border);
    border-radius: 13px;
    background: #fff;
}
.af-manual-steps li > span {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(var(--af-primary-rgb), .1);
    color: var(--af-primary);
    font-weight: 900;
}
.af-manual-steps strong { display: block; font-size: 13px; color: #0f172a; }
.af-manual-steps p { margin: 4px 0 0; color: #64748b; font-size: 12px; line-height: 1.55; }

.af-manual-numbered {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    counter-reset: manual-step;
    list-style: none;
}
.af-manual-numbered li {
    position: relative;
    min-height: 34px;
    padding: 8px 10px 8px 42px;
    border: 1px solid #e8edf3;
    border-radius: 10px;
    background: #fbfcfe;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.55;
    counter-increment: manual-step;
}
.af-manual-numbered li::before {
    content: counter(manual-step);
    position: absolute;
    left: 9px;
    top: 8px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: var(--af-primary);
    font-size: 11px;
    font-weight: 900;
}

.af-manual-list {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.af-manual-list li {
    position: relative;
    padding-left: 22px;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.55;
}
.af-manual-list li::before {
    content: "\f058";
    position: absolute;
    left: 0;
    top: 1px;
    color: #16a34a;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.af-manual-callout {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid;
    border-radius: 12px;
}
.af-manual-callout > i { margin-top: 2px; font-size: 17px; }
.af-manual-callout strong { display: block; font-size: 13px; }
.af-manual-callout p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; }
.af-manual-callout--warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.af-manual-callout--info { border-color: #bfdbfe; background: #eff6ff; color: #1e40af; }
.af-manual-callout--danger { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

.af-manual-provider-grid,
.af-manual-renewal-grid,
.af-manual-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
}

.af-manual-provider-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--af-border);
    border-radius: 13px;
    background: #fff;
}
.af-manual-provider-card > span {
    width: 37px;
    height: 37px;
    flex: 0 0 37px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 17px;
}
.af-manual-provider-card h3 { margin: 0; font-size: 13px; font-weight: 900; }
.af-manual-provider-card p { margin: 4px 0 7px; color: #64748b; font-size: 11.5px; line-height: 1.45; }
.af-manual-provider-card code,
.af-manual-renewal-grid code {
    display: block;
    margin-top: 5px;
    color: #334155;
    font-size: 10.5px;
    font-weight: 800;
    word-break: break-word;
}
.af-manual-provider-card--gmail > span { background: #fef2f2; color: #dc2626; }
.af-manual-provider-card--namecheap > span { background: #eff6ff; color: #2563eb; }
.af-manual-provider-card--cpanel > span { background: #f0fdf4; color: #15803d; }

.af-manual-details {
    overflow: hidden;
    border: 1px solid var(--af-border);
    border-radius: 12px;
    background: #fff;
}
.af-manual-details summary {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 14px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}
.af-manual-details summary::-webkit-details-marker { display: none; }
.af-manual-details summary::after {
    content: "\f078";
    margin-left: auto;
    color: #64748b;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform .18s ease;
}
.af-manual-details[open] summary::after { transform: rotate(180deg); }
.af-manual-details > :not(summary) { margin: 12px 14px; }

.af-manual-privacy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.af-manual-privacy {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px;
    border: 1px solid;
    border-radius: 12px;
}
.af-manual-privacy i { font-size: 18px; margin-top: 2px; }
.af-manual-privacy strong { display: block; font-size: 13px; }
.af-manual-privacy p { margin: 4px 0 0; font-size: 11.5px; line-height: 1.45; }
.af-manual-privacy--private { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.af-manual-privacy--public { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }

.af-manual-message-example {
    overflow: hidden;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    background: #f0fdf4;
}
.af-manual-message-example > strong { display: block; padding: 10px 13px; border-bottom: 1px solid #bbf7d0; color: #166534; font-size: 12px; }
.af-manual-message-example pre {
    margin: 0;
    padding: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #14532d;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.55;
}

.af-manual-code-block {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #0f172a;
}
.af-manual-code-block code { color: #e2e8f0; font-size: 11.5px; word-break: break-all; }

.af-manual-status-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.af-manual-status-grid span,
.af-manual-action-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}
.af-manual-status-grid .is-danger { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.af-manual-status-grid .is-today { border-color: #fed7aa; background: #fff7ed; color: #c2410c; }
.af-manual-status-grid .is-warning { border-color: #fde68a; background: #fffbeb; color: #a16207; }
.af-manual-status-grid .is-info { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.af-manual-status-grid .is-success { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }

.af-manual-renewal-grid article,
.af-manual-check-grid article {
    padding: 13px;
    border: 1px solid var(--af-border);
    border-radius: 12px;
    background: #fff;
}
.af-manual-renewal-grid strong,
.af-manual-check-grid strong { display: block; color: #0f172a; font-size: 13px; }
.af-manual-renewal-grid p { margin: 5px 0; color: #64748b; font-size: 11.5px; line-height: 1.5; }
.af-manual-check-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.af-manual-check-grid ul { margin: 8px 0 0; padding-left: 17px; color: #64748b; font-size: 11.5px; line-height: 1.6; }

.af-manual-action-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}
.af-manual-action-grid article {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px;
    border: 1px solid var(--af-border);
    border-radius: 11px;
    background: #fff;
}
.af-manual-action-grid article > i { margin-top: 2px; }
.af-manual-action-grid strong { display: block; font-size: 11.5px; }
.af-manual-action-grid p { margin: 3px 0 0; color: #64748b; font-size: 10.5px; line-height: 1.4; }
.af-manual-action-grid .is-blue > i { color: #2563eb; }
.af-manual-action-grid .is-green > i { color: #16a34a; }
.af-manual-action-grid .is-red > i { color: #dc2626; }
.af-manual-action-grid .is-amber > i { color: #d97706; }
.af-manual-action-grid .is-danger > i { color: #b91c1c; }

.af-manual-action-legend { display: flex; flex-wrap: wrap; gap: 7px; }
.af-manual-action-legend .is-blue { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.af-manual-action-legend .is-green { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.af-manual-action-legend .is-cyan { color: #0e7490; background: #ecfeff; border-color: #a5f3fc; }
.af-manual-action-legend .is-amber { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.af-manual-action-legend .is-red { color: #c2410c; background: #fff7ed; border-color: #fed7aa; }
.af-manual-action-legend .is-danger { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.af-manual-action-legend .is-violet { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }

.af-manual-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.af-manual-no-results { padding: 34px; border: 1px dashed #cbd5e1; border-radius: 14px; background: #fff; }

@media (max-width: 1180px) {
    .af-manual-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .af-manual-steps--flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .af-manual-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .af-manual-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .af-manual-search-row { align-items: stretch; flex-direction: column; }
    .af-manual-version { min-width: 0; }
    .af-manual-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .af-manual-steps--flow,
    .af-manual-provider-grid,
    .af-manual-renewal-grid,
    .af-manual-action-grid,
    .af-manual-check-grid,
    .af-manual-faq-grid,
    .af-manual-privacy-grid { grid-template-columns: 1fr; }
    .af-mailbox-guides { gap: 13px; }
    .af-mailbox-server-grid { grid-template-columns: 1fr; }
    .af-mailbox-server-grid .full { grid-column: auto; }
}

@media print {
    .premium-sidebar,
    .premium-topbar,
    .premium-footer,
    .af-manual-search-panel,
    .af-manual-nav,
    #printManual,
    .af-heading-actions { display: none !important; }
    .premium-content { margin: 0 !important; width: 100% !important; }
    .admin-main { padding: 0 !important; }
    .af-page { width: 100% !important; }
    .af-panel,
    .af-heading { box-shadow: none !important; break-inside: avoid; }
    .af-manual-details { break-inside: avoid; }
}


/* ======================================================================
   Manual Admin profesional — secciones diferenciadas y lectura compacta
   ====================================================================== */
.af-manual-section {
    --manual-accent: 239, 68, 68;
    position: relative;
    overflow: hidden;
    border-color: rgba(var(--manual-accent), .20);
    background: linear-gradient(180deg, rgba(var(--manual-accent), .035), #fff 150px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .055);
}
.af-manual-section::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: rgb(var(--manual-accent));
}
.af-manual-section .af-panel-head {
    border-bottom-color: rgba(var(--manual-accent), .16);
    background:
        linear-gradient(90deg, rgba(var(--manual-accent), .075), rgba(var(--manual-accent), .018) 46%, transparent 76%);
}
.af-manual-section .af-panel-title-icon {
    border: 1px solid rgba(var(--manual-accent), .18);
    background: rgba(var(--manual-accent), .10);
    color: rgb(var(--manual-accent));
    box-shadow: 0 6px 14px rgba(var(--manual-accent), .10);
}
.af-manual-section .af-panel-title h2 {
    letter-spacing: -.018em;
}
.af-manual-section .af-panel-body {
    background: linear-gradient(180deg, rgba(255,255,255,.76), #fff 180px);
}
.af-manual-section--coral { --manual-accent: 239, 68, 68; }
.af-manual-section--blue { --manual-accent: 37, 99, 235; }
.af-manual-section--amber { --manual-accent: 217, 119, 6; }
.af-manual-section--violet { --manual-accent: 124, 58, 237; }
.af-manual-section--cyan { --manual-accent: 8, 145, 178; }
.af-manual-section--emerald { --manual-accent: 5, 150, 105; }
.af-manual-section--purple { --manual-accent: 147, 51, 234; }
.af-manual-section--indigo { --manual-accent: 79, 70, 229; }
.af-manual-section--slate { --manual-accent: 71, 85, 105; }
.af-manual-section--orange { --manual-accent: 234, 88, 12; }
.af-manual-section--green { --manual-accent: 22, 163, 74; }

.af-manual-content > h3 {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(var(--manual-accent), .13);
    border-radius: 11px;
    background: rgba(var(--manual-accent), .055);
    color: #172033;
    font-size: 13.5px;
}
.af-manual-content > h3 i {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    color: rgb(var(--manual-accent));
    box-shadow: 0 3px 9px rgba(15, 23, 42, .07);
}
.af-manual-numbered,
.af-manual-list {
    padding: 10px;
    border: 1px solid rgba(var(--manual-accent), .10);
    border-radius: 12px;
    background: rgba(255, 255, 255, .74);
}
.af-manual-numbered li {
    border-color: rgba(var(--manual-accent), .11);
    background: rgba(var(--manual-accent), .025);
}
.af-manual-numbered li::before {
    border-color: rgba(var(--manual-accent), .25);
    color: rgb(var(--manual-accent));
}
.af-manual-list li::before { color: rgb(var(--manual-accent)); }

.af-manual-nav a i {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(var(--af-primary-rgb), .08);
}

.af-manual-faq-grid { align-items: start; }
.af-manual-faq-grid .af-manual-details {
    border-color: rgba(var(--manual-accent), .15);
    box-shadow: 0 5px 14px rgba(15, 23, 42, .04);
}
.af-manual-faq-grid .af-manual-details summary {
    min-height: 45px;
    padding: 10px 12px;
    background: rgba(var(--manual-accent), .045);
    font-size: 11.5px;
    line-height: 1.35;
}
.af-manual-faq-grid .af-manual-details summary > i {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    color: rgb(var(--manual-accent));
    box-shadow: 0 3px 8px rgba(15, 23, 42, .07);
}
.af-manual-faq-grid .af-manual-details summary > span {
    min-width: 0;
    flex: 1;
}
.af-manual-faq-grid .af-manual-details > div {
    margin: 0;
    padding: 10px 13px 12px;
    border-top: 1px solid rgba(var(--manual-accent), .10);
    background: #fff;
}
.af-manual-faq-grid .af-manual-details p {
    margin: 0;
    color: #5b6678;
    font-size: 11.5px;
    line-height: 1.55;
}

.af-manual-check-card { position: relative; padding-top: 49px !important; }
.af-manual-check-icon {
    position: absolute;
    left: 13px;
    top: 12px;
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(var(--manual-accent), .10);
    color: rgb(var(--manual-accent));
}
.af-manual-check-card--daily { border-top: 3px solid #f59e0b !important; }
.af-manual-check-card--weekly { border-top: 3px solid #2563eb !important; }
.af-manual-check-card--renew { border-top: 3px solid #16a34a !important; }
.af-manual-check-card--delete { border-top: 3px solid #dc2626 !important; }

@media (max-width: 760px) {
    .af-manual-section::before { width: 3px; }
    .af-manual-content > h3 { font-size: 13px; }
    .af-manual-faq-grid .af-manual-details summary { font-size: 11.25px; }
}


/* ======================================================================
   Cierre visual Admin 8.0
   ====================================================================== */

/* Botones principales compactos: evita que Tailwind o estilos heredados
   conviertan las acciones de cabecera en barras de ancho completo. */
body.admin-premium .admin-main .af-heading {
    align-items: center !important;
}
body.admin-premium .admin-main .af-heading-main {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}
body.admin-premium .admin-main .af-heading-actions {
    width: auto !important;
    min-width: 0 !important;
    max-width: 560px !important;
    flex: 0 0 auto !important;
    align-self: center !important;
    display: flex !important;
    flex-flow: row wrap !important;
    justify-content: flex-end !important;
    gap: 9px !important;
}
body.admin-premium .admin-main .af-heading-actions > .af-btn,
body.admin-premium .admin-main .af-heading-actions > button,
body.admin-premium .admin-main .af-heading-actions > a {
    width: auto !important;
    inline-size: max-content !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
    padding-inline: 15px !important;
    white-space: nowrap !important;
}

/* Dominios: nombre completo del asunto, sin puntos suspensivos ni recortes. */
.af-domain-subjects .af-subject-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch;
}
.af-domain-subjects .af-check-item {
    min-height: 62px !important;
    align-items: flex-start !important;
    flex-wrap: wrap;
    padding: 8px 9px !important;
}
.af-domain-subjects .af-check-main {
    min-width: 150px !important;
    align-items: flex-start !important;
}
.af-domain-subjects .af-subject-name {
    min-width: 0;
    flex: 1 1 150px;
}
.af-domain-subjects .af-check-main strong,
.af-domain-subjects .af-subject-name strong {
    display: block !important;
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: clip !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    font-size: 11.25px !important;
    line-height: 1.35 !important;
}
.af-domain-subjects .af-visibility-switch {
    margin-left: auto;
    align-self: center;
}

/* Semáforo compacto del plan, visible en toda la barra superior del Admin. */
.topbar-plan-chip {
    min-width: 260px;
    height: 42px;
    display: grid;
    grid-template-columns: 9px 30px minmax(92px, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 7px;
    border: 1px solid #dbe3ec;
    border-radius: 13px;
    background: #fff;
    color: #334155;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(15,23,42,.05);
}
.topbar-plan-chip:hover { border-color: #cbd5e1; transform: translateY(-1px); }
.topbar-plan-light { width: 9px; height: 9px; border-radius: 999px; background: #94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,.14); }
.topbar-plan-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #f1f5f9; color: #475569; }
.topbar-plan-copy { min-width: 0; line-height: 1.12; }
.topbar-plan-copy strong, .topbar-plan-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar-plan-copy strong { color: #0f172a; font-size: 11.5px; font-weight: 900; }
.topbar-plan-copy span { margin-top: 2px; color: #64748b; font-size: 9.5px; }
.topbar-plan-days { padding: 5px 7px; border-radius: 8px; background: #f1f5f9; color: #475569; font-size: 9.5px; font-weight: 900; white-space: nowrap; }
.topbar-plan-chip.is-success .topbar-plan-light { background: #16a34a; box-shadow: 0 0 0 4px rgba(22,163,74,.14); }
.topbar-plan-chip.is-success .topbar-plan-icon, .topbar-plan-chip.is-success .topbar-plan-days { background: #f0fdf4; color: #15803d; }
.topbar-plan-chip.is-attention .topbar-plan-light { background: #eab308; box-shadow: 0 0 0 4px rgba(234,179,8,.15); }
.topbar-plan-chip.is-attention .topbar-plan-icon, .topbar-plan-chip.is-attention .topbar-plan-days { background: #fefce8; color: #a16207; }
.topbar-plan-chip.is-warning .topbar-plan-light { background: #f97316; box-shadow: 0 0 0 4px rgba(249,115,22,.14); }
.topbar-plan-chip.is-warning .topbar-plan-icon, .topbar-plan-chip.is-warning .topbar-plan-days { background: #fff7ed; color: #c2410c; }
.topbar-plan-chip.is-danger .topbar-plan-light { background: #dc2626; box-shadow: 0 0 0 4px rgba(220,38,38,.14); }
.topbar-plan-chip.is-danger .topbar-plan-icon, .topbar-plan-chip.is-danger .topbar-plan-days { background: #fef2f2; color: #b91c1c; }

/* Pie fijo del panel. Se reserva espacio para que no cubra tablas o botones. */
body.admin-premium .premium-content { padding-bottom: 45px; }
body.admin-premium .premium-footer {
    position: fixed;
    left: 248px;
    right: 0;
    bottom: 0;
    z-index: 34;
    min-height: 44px;
    box-shadow: 0 -5px 18px rgba(15,23,42,.045);
}
body.admin-premium .admin-shell.sidebar-collapsed .premium-footer { left: 78px; }

/* Manual: panel visual de módulos y pasos convertidos en tarjetas. */
.af-manual-visual-map {
    padding: 17px 18px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff6ff, #fff 54%, #fef2f2);
    box-shadow: var(--af-shadow);
}
.af-manual-map-head { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.af-manual-map-icon { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: #2563eb; box-shadow: 0 7px 18px rgba(37,99,235,.12); }
.af-manual-map-head h2 { margin: 0; color: #0f172a; font-size: 16px; font-weight: 900; }
.af-manual-map-head p { margin: 3px 0 0; color: #64748b; font-size: 11.5px; }
.af-manual-map-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.af-manual-map-card { min-width: 0; display: grid; grid-template-columns: 31px minmax(0,1fr) 14px; align-items: center; gap: 8px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 12px; background: rgba(255,255,255,.9); color: #334155; text-decoration: none; transition: .16s ease; }
.af-manual-map-card:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: 0 8px 18px rgba(15,23,42,.07); }
.af-manual-map-card > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #f1f5f9; }
.af-manual-map-card strong, .af-manual-map-card small { display: block; }
.af-manual-map-card strong { font-size: 10.5px; font-weight: 900; color: #0f172a; }
.af-manual-map-card small { margin-top: 2px; color: #64748b; font-size: 9px; line-height: 1.3; }
.af-manual-map-card > i { color: #94a3b8; font-size: 9px; }
.af-manual-map-card.is-mail > span { background:#fff7ed; color:#c2410c; }
.af-manual-map-card.is-domain > span { background:#f5f3ff; color:#7c3aed; }
.af-manual-map-card.is-client > span { background:#ecfeff; color:#0891b2; }
.af-manual-map-card.is-account > span { background:#f0fdf4; color:#15803d; }
.af-manual-map-card.is-report > span { background:#eef2ff; color:#4f46e5; }
.af-manual-map-card.is-action > span { background:#f0fdf4; color:#16a34a; }

.af-manual-content .af-manual-visual-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
.af-manual-content .af-manual-visual-list > li {
    min-height: 55px;
    margin: 0 !important;
    padding: 10px 11px 10px 39px !important;
    border: 1px solid rgba(var(--manual-accent), .13) !important;
    border-radius: 11px !important;
    background: linear-gradient(135deg, rgba(var(--manual-accent), .045), #fff 72%) !important;
    color: #475569;
    font-size: 11.5px;
    line-height: 1.5;
}
.af-manual-content ol.af-manual-visual-list > li::before {
    left: 10px !important;
    top: 10px !important;
    width: 23px !important;
    height: 23px !important;
    display: grid !important;
    place-items: center !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: rgb(var(--manual-accent)) !important;
    color: #fff !important;
    font-size: 10px !important;
    box-shadow: 0 4px 10px rgba(var(--manual-accent), .16);
}
.af-manual-content ul.af-manual-visual-list > li::before {
    content: "\f00c" !important;
    position: absolute;
    left: 11px !important;
    top: 11px !important;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(var(--manual-accent), .10);
    color: rgb(var(--manual-accent));
    font-family: "Font Awesome 6 Free";
    font-size: 10px;
    font-weight: 900;
}

@media (max-width: 1250px) {
    .topbar-plan-chip { min-width: 210px; grid-template-columns: 9px 28px minmax(75px,1fr); }
    .topbar-plan-days { display: none; }
    .af-manual-map-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1024px) {
    body.admin-premium .premium-footer,
    body.admin-premium .admin-shell.sidebar-collapsed .premium-footer { left: 0; }
    .topbar-plan-chip { min-width: 42px; width: 42px; grid-template-columns: 1fr; padding: 5px; }
    .topbar-plan-light, .topbar-plan-copy, .topbar-plan-days { display: none; }
    .topbar-plan-icon { margin: auto; }
}
@media (max-width: 760px) {
    body.admin-premium .admin-main .af-heading { align-items: flex-start !important; }
    body.admin-premium .admin-main .af-heading-actions { width: 100% !important; max-width: none !important; justify-content: flex-start !important; }
    body.admin-premium .admin-main .af-heading-actions > .af-btn,
    body.admin-premium .admin-main .af-heading-actions > button,
    body.admin-premium .admin-main .af-heading-actions > a { flex: 1 1 145px !important; inline-size: auto !important; }
    .af-domain-subjects .af-subject-group-grid { grid-template-columns: 1fr !important; }
    .af-manual-map-grid, .af-manual-content .af-manual-visual-list { grid-template-columns: 1fr; }
}

/* Iconos descriptivos dentro de los botones principales. */
body.admin-premium .admin-main .af-heading-actions > .af-btn {
    min-height: 41px;
    border-radius: 12px;
    box-shadow: 0 7px 16px rgba(15,23,42,.08);
}
body.admin-premium .admin-main .af-heading-actions > .af-btn > i {
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(255,255,255,.17);
    font-size: 11px;
}
body.admin-premium .admin-main .af-heading-actions > .af-btn-secondary > i {
    background: #f1f5f9;
    color: #475569;
}


/* ======================================================================
   Ajustes operativos 8.3
   ====================================================================== */

/* Todos los botones principales de las cabeceras usan exactamente la misma
   altura que Exportar. Evita que Nueva cuenta, Carga masiva o Nuevo cliente
   crezcan por el icono, estilos heredados o contenido interno. */
body.admin-premium .admin-main .af-heading-actions > .af-btn,
body.admin-premium .admin-main .af-heading-actions > button.af-btn,
body.admin-premium .admin-main .af-heading-actions > a.af-btn {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 14px !important;
    line-height: 1 !important;
    align-self: center !important;
}
body.admin-premium .admin-main .af-heading-actions > .af-btn > i,
body.admin-premium .admin-main .af-heading-actions > button.af-btn > i,
body.admin-premium .admin-main .af-heading-actions > a.af-btn > i {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
}

/* Dominios: cada plataforma se reconoce mediante una superficie suave.
   La paleta se repite y no cambia el significado público/privado. */
.af-domain-subjects .af-subject-group {
    --af-platform-soft: #f8fafc;
    --af-platform-line: #cbd5e1;
    background: var(--af-platform-soft) !important;
    border-color: var(--af-platform-line) !important;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .035);
}
.af-domain-subjects .af-subject-group:nth-child(6n + 1) {
    --af-platform-soft: #fff8f7;
    --af-platform-line: #fecaca;
}
.af-domain-subjects .af-subject-group:nth-child(6n + 2) {
    --af-platform-soft: #f7fbff;
    --af-platform-line: #bfdbfe;
}
.af-domain-subjects .af-subject-group:nth-child(6n + 3) {
    --af-platform-soft: #f7fcf8;
    --af-platform-line: #bbf7d0;
}
.af-domain-subjects .af-subject-group:nth-child(6n + 4) {
    --af-platform-soft: #fffbf2;
    --af-platform-line: #fde68a;
}
.af-domain-subjects .af-subject-group:nth-child(6n + 5) {
    --af-platform-soft: #faf8ff;
    --af-platform-line: #ddd6fe;
}
.af-domain-subjects .af-subject-group:nth-child(6n + 6) {
    --af-platform-soft: #f5fcfc;
    --af-platform-line: #a5f3fc;
}
.af-domain-subjects .af-subject-group-title {
    background: color-mix(in srgb, var(--af-platform-soft) 76%, #ffffff) !important;
    border-bottom-color: var(--af-platform-line) !important;
}
.af-domain-subjects .af-subject-group-grid {
    background: transparent !important;
}
.af-domain-subjects .af-check-item {
    background: rgba(255, 255, 255, .82) !important;
    border-color: color-mix(in srgb, var(--af-platform-line) 65%, #e2e8f0) !important;
}

/* Compatibilidad para navegadores sin color-mix. */
@supports not (color: color-mix(in srgb, red, blue)) {
    .af-domain-subjects .af-subject-group-title { background: var(--af-platform-soft) !important; }
    .af-domain-subjects .af-check-item { border-color: var(--af-platform-line) !important; }
}


/* ======================================================================
   Ajustes de experiencia 8.4
   ====================================================================== */

/* Barra superior: accesos rápidos compactos y con jerarquía visual. */
.topbar-quick-link {
    min-height: 42px;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 5px !important;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    background: #fff;
    color: #334155 !important;
    text-decoration: none !important;
    box-shadow: 0 4px 13px rgba(15,23,42,.045);
}
.topbar-quick-link:hover { border-color: #cbd5e1; background: #f8fafc; transform: translateY(-1px); }
.topbar-quick-icon {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
}
.topbar-quick-copy { min-width: 0; display: grid; line-height: 1.05; }
.topbar-quick-copy strong { color: #0f172a; font-size: 11px; font-weight: 900; white-space: nowrap; }
.topbar-quick-copy small { margin-top: 3px; color: #64748b; font-size: 8.5px; font-weight: 700; white-space: nowrap; }

/* Buzones: separar la explicación de seguridad del primer campo. */
.af-mailbox-security-guide {
    margin: 0 0 17px !important;
    padding: 12px 14px !important;
    align-items: flex-start !important;
}
.af-mailbox-security-guide > i { margin-top: 2px; }
.af-mailbox-security-guide strong,
.af-mailbox-security-guide span { display: block; }
.af-mailbox-security-guide span { margin-top: 3px; color: #64748b; font-size: 11.5px; line-height: 1.45; }

/* Modal Mis datos. */
.af-profile-modal { width: min(500px, 100%) !important; }
.af-profile-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 13px;
    border: 1px solid #dbeafe;
    border-radius: 13px;
    background: linear-gradient(135deg, #eff6ff, #fff);
}
.af-profile-summary > span { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: #dbeafe; color: #2563eb; font-size: 18px; }
.af-profile-summary strong, .af-profile-summary small { display: block; }
.af-profile-summary strong { color: #0f172a; font-size: 13px; font-weight: 900; }
.af-profile-summary small { margin-top: 3px; color: #64748b; font-size: 10.5px; }
.af-profile-form-grid { gap: 13px !important; }
.af-profile-form-grid .af-label { display: flex; align-items: center; gap: 7px; }
.af-profile-form-grid .af-label i { width: 15px; color: var(--af-primary); text-align: center; }
.af-optional { margin-left: auto; color: #94a3b8; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

/* Modal Mi plan. */
.af-plan-modal { width: min(700px, 100%) !important; }
.af-current-plan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid #bfdbfe;
    border-radius: 15px;
    background: linear-gradient(135deg, #eff6ff, #fff 64%);
}
.af-current-plan-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.af-current-plan-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 12px; background: #dbeafe; color: #2563eb; font-size: 17px; }
.af-current-plan-main span, .af-current-plan-main strong, .af-current-plan-main small { display: block; }
.af-current-plan-main span { color: #64748b; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.af-current-plan-main strong { margin-top: 2px; color: #0f172a; font-size: 16px; font-weight: 900; }
.af-current-plan-main small { margin-top: 3px; color: #64748b; font-size: 10.5px; }
.af-plan-capacity-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.af-plan-capacity-grid > div { min-width: 0; display: grid; grid-template-columns: 26px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 8px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.af-plan-capacity-grid i { grid-row: 1/3; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: #fef2f2; color: var(--af-primary); }
.af-plan-capacity-grid span { color: #64748b; font-size: 9px; font-weight: 800; }
.af-plan-capacity-grid strong { margin-top: 2px; color: #0f172a; font-size: 10.5px; font-weight: 900; }
.af-plan-section-title { margin: 17px 0 9px; }
.af-plan-section-title h3 { margin: 0; color: #0f172a; font-size: 13px; font-weight: 900; }
.af-plan-section-title p { margin: 3px 0 0; color: #64748b; font-size: 10.5px; }
.af-plan-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.af-plan-option-card { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; box-shadow: 0 5px 14px rgba(15,23,42,.04); }
.af-plan-option-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 13px 9px; border-bottom: 1px solid #eef2f7; }
.af-plan-option-head span { color: #94a3b8; font-size: 8.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.af-plan-option-head h3 { margin: 3px 0 0; color: #0f172a; font-size: 13px; font-weight: 900; }
.af-plan-option-head > i { color: #94a3b8; }
.af-plan-price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 13px; }
.af-plan-price-row span { padding: 7px 8px; border-radius: 9px; background: #f8fafc; }
.af-plan-price-row small, .af-plan-price-row strong { display: block; }
.af-plan-price-row small { color: #64748b; font-size: 8.5px; }
.af-plan-price-row strong { margin-top: 2px; color: #0f172a; font-size: 10.5px; }
.af-plan-limit-list { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 13px 11px; }
.af-plan-limit-list span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 8.5px; font-weight: 800; }
.af-plan-option-card > .af-btn { width: calc(100% - 26px); margin: 0 13px 13px; min-height: 36px; }

@media (max-width: 1200px) {
    .topbar-quick-copy small { display: none; }
    .topbar-quick-link { padding-right: 8px !important; }
}
@media (max-width: 900px) {
    .topbar-quick-copy { display: none; }
    .topbar-quick-link { width: 40px; min-width: 40px; padding: 4px !important; }
    .topbar-quick-icon { margin: auto; }
}
@media (max-width: 700px) {
    .af-plan-capacity-grid, .af-plan-options { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .af-plan-capacity-grid, .af-plan-options { grid-template-columns: 1fr; }
    .af-current-plan-card { align-items: flex-start; }
}


/* ======================================================================
   Refinamiento 8.5: manual, proveedores IMAP y solicitudes de planes
   ====================================================================== */
.af-manual-search-field {
    flex: 1 1 960px;
    max-width: none;
}
.af-manual-search-field .af-control {
    width: 100%;
    min-width: 0;
}
.af-manual-version {
    flex: 0 0 285px;
}

.af-mailbox-guides {
    display: grid;
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 18px;
}
.af-mailbox-provider-guide {
    margin: 0 !important;
}
.af-mailbox-guide-namecheap {
    border: 1px solid #93c5fd !important;
    background: #eff6ff !important;
    color: #1e40af !important;
}
.af-mailbox-guide-namecheap > i { color: #2563eb !important; }
.af-mailbox-guide-cpanel {
    border: 1px solid #99f6e4 !important;
    background: #f0fdfa !important;
    color: #115e59 !important;
}
.af-mailbox-guide-cpanel > i { color: #0f766e !important; }
.af-provider-preset {
    margin-top: 4px !important;
    margin-bottom: 20px !important;
}
.af-mailbox-meta {
    margin-top: 4px !important;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}
.af-whatsapp-preview { text-align: left; }
.af-whatsapp-preview > p { margin: 0 0 12px; color: #64748b; font-size: 13px; }
.af-whatsapp-preview > div {
    max-height: 360px;
    overflow: auto;
    padding: 16px;
    border: 1px solid #dbe3ee;
    border-radius: 13px;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.65;
}
@media (max-width: 800px) {
    .af-manual-search-row { align-items: stretch; }
    .af-manual-version { flex-basis: auto; width: 100%; }
}


/* ======================================================================
   Ajustes 8.6: buscador completo del manual y selección segura de planes
   ====================================================================== */
.af-manual-search-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 260px !important;
    align-items: end !important;
    gap: 18px !important;
}
.af-manual-search-field {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none !important;
}
.af-manual-search-field .af-control,
.af-manual-search-input {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    text-align: left !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
}
.af-manual-search-input::placeholder {
    text-align: left !important;
    opacity: 1 !important;
}
.af-manual-version {
    width: 260px !important;
    min-width: 260px !important;
}
.solicitar-plan-whatsapp-btn {
    position: relative;
    z-index: 1;
}
@media (max-width: 820px) {
    .af-manual-search-row { grid-template-columns: 1fr !important; align-items: stretch !important; }
    .af-manual-version { width: 100% !important; min-width: 0 !important; }
}


/* ======================================================================
   Dominios 8.7: selector estable dentro de listas con desplazamiento.
   Evita que el foco del checkbox oculto desplace el modal o deje el cuerpo
   visualmente en blanco al cambiar Público / Privado cerca del final.
   ====================================================================== */
.af-domain-subjects,
.af-domain-subjects .af-subject-groups,
.af-domain-subjects .af-subject-group,
.af-domain-subjects .af-check-item {
    overflow-anchor: none;
}
.af-domain-subjects .af-visibility-switch {
    position: relative;
    isolation: isolate;
    flex: 0 0 auto;
}
.af-domain-subjects .af-visibility-switch input {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: auto !important;
    cursor: pointer;
    z-index: 2;
}
.af-domain-subjects .af-visibility-switch input:disabled {
    cursor: not-allowed;
}
.af-domain-subjects .af-visibility-switch__status {
    position: relative;
    z-index: 1;
}

/* Modal Mi plan · modalidades configurables */
.af-plan-option-description {
    min-height: 42px;
    margin: 0;
    padding: 10px 13px 0;
    color: #64748b;
    font-size: 10px;
    line-height: 1.5;
}
.af-plan-price-row.is-single { grid-template-columns: 1fr; }
