* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #0b1120;
    color: #f8fafc;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 45px;
    background: #172033;
    border: 1px solid #29364d;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0,0,0,.25);
}

.logo {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,#2563eb,#06b6d4);
    border-radius: 14px;
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 25px;
}

h1 {
    margin: 0 0 12px;
    font-size: 32px;
}

.subtitle {
    color: #94a3b8;
    margin-bottom: 35px;
}

label {
    display: block;
    font-size: 13px;
    margin: 20px 0 9px;
    color: #cbd5e1;
}

input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #334155;
    border-radius: 9px;
    background: #0f172a;
    color: white;
    font-size: 15px;
    outline: none;
}

input:focus {
    border-color: #3b82f6;
}

button {
    width: 100%;
    margin-top: 25px;
    padding: 15px;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

.error {
    background: #451a1a;
    color: #fca5a5;
    padding: 13px;
    border-radius: 8px;
    font-size: 14px;
}

.footer {
    margin-top: 35px;
    text-align: center;
    color: #64748b;
    font-size: 12px;
}

.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 255px;
    background: #111827;
    border-right: 1px solid #253044;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 21px;
    font-weight: 750;
    margin-bottom: 45px;
}

.brand-icon {
    display: inline-block;
    background: #2563eb;
    padding: 8px 12px;
    border-radius: 9px;
    margin-right: 8px;
}

nav a {
    display: block;
    padding: 14px;
    margin-bottom: 8px;
    color: #94a3b8;
    border-radius: 8px;
    text-decoration: none;
}

nav a.active {
    background: #1e3a5f;
    color: #60a5fa;
}

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-bottom button {
    background: #263247;
}

.main {
    flex: 1;
    padding: 35px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.topbar h2 {
    margin: 0 0 8px;
}

.topbar p {
    color: #94a3b8;
}

.user-badge {
    background: #1e293b;
    padding: 12px 20px;
    border-radius: 9px;
}

.welcome {
    padding: 35px;
    background: linear-gradient(120deg,#1e3a8a,#172033);
    border-radius: 16px;
    margin-bottom: 25px;
}

.welcome p {
    color: #cbd5e1;
}

.status {
    display: inline-block;
    margin-top: 15px;
    padding: 9px 15px;
    background: #064e3b;
    color: #6ee7b7;
    border-radius: 8px;
    font-size: 13px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
}

.stat-card,
.info-card {
    background: #172033;
    border: 1px solid #29364d;
    padding: 25px;
    border-radius: 14px;
}

.stat-card h3 {
    color: #94a3b8;
    font-size: 14px;
}

.stat-number {
    font-size: 35px;
    font-weight: 700;
    margin: 20px 0;
}

.stat-card p,
.info-card p {
    color: #94a3b8;
}

.info-card {
    margin-top: 25px;
}

@media(max-width:850px) {
    .sidebar {
        display: none;
    }

    .main {
        padding: 20px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .topbar {
        gap: 15px;
    }

    .welcome {
        padding: 25px;
    }
}


/* MAILCONTROL - DOMINIOS */

.domains-section {
    margin-top: 25px;
}

.domains-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.domains-header h3 {
    margin: 0 0 8px;
    font-size: 19px;
}

.domains-header p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
}

.domains-count {
    background: #1e3a5f;
    color: #93c5fd;
    padding: 9px 15px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.domains-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.domains-table th {
    padding: 17px;
    font-size: 11px;
    letter-spacing: 0.8px;
    color: #94a3b8;
    background: #111827;
    border-bottom: 1px solid #334155;
}

.domains-table td {
    padding: 18px 17px;
    border-bottom: 1px solid #29364d;
    font-size: 14px;
}

.domains-table tbody tr:hover {
    background: #1e293b;
}

.domain-name {
    display: flex;
    align-items: center;
    gap: 13px;
    font-weight: 600;
}

.domain-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #1e3a5f;
    color: #60a5fa;
    font-size: 18px;
}

.email-count {
    display: inline-block;
    min-width: 40px;
    text-align: center;
    padding: 8px 12px;
    background: #253247;
    border-radius: 7px;
}

.badge-active,
.badge-inactive {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
}

.badge-active {
    background: #064e3b;
    color: #6ee7b7;
}

.badge-inactive {
    background: #451a1a;
    color: #fca5a5;
}

@media (max-width: 650px) {
    .domains-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .domains-table {
        min-width: 550px;
    }
}

/* MAILCONTROL - CUENTAS DE CORREO */

.mail-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px 0;
}

.mail-filters select,
.mail-filters input {
    background: #111827;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
}

.mail-filters select {
    min-width: 190px;
}

.mail-filters input {
    flex: 1;
    min-width: 220px;
}

.mail-filters button {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
}

.mail-filters a {
    color: #93c5fd;
    text-decoration: none;
    font-size: 13px;
}

.mail-error {
    padding: 16px;
    background: #451a1a;
    color: #fca5a5;
    border-radius: 8px;
}

/* MAILCONTROL - CREAR CUENTA */

.mail-create-card {
    max-width: 680px;
    margin-top: 25px;
}

.mail-create-card h3 {
    margin-bottom: 25px;
}

.mail-create-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mail-create-form label {
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
}

.mail-create-form input,
.mail-create-form select {
    width: 100%;
    box-sizing: border-box;
    background: #111827;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 13px;
    font-size: 14px;
}

.mail-create-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.mail-create-actions button {
    background: #2563eb;
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 13px 22px;
    cursor: pointer;
}

.mail-create-actions a {
    color: #93c5fd;
    text-decoration: none;
}

.mail-success {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: #064e3b;
    color: #a7f3d0;
}

.mail-new-button {
    display: inline-block;
    padding: 11px 17px;
    background: #2563eb;
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}


/* ==========================================
   MAILCONTROL - MEJORAS CUENTAS DE CORREO
   ========================================== */

/* Encabezado del listado */
.domains-section .domains-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}

/* Contenedor del botón y contador */
.domains-section .mail-create-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0;
}

/* Botón Crear cuenta */
.domains-section a.mail-new-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 20px;
    background: #2563eb;
    color: #ffffff !important;
    border: 1px solid #3b82f6;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    line-height: 1.2;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
}

.domains-section a.mail-new-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* Barra de filtros */
.domains-section form.mail-filters {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) minmax(240px, 1.6fr) auto auto;
    align-items: center;
    gap: 12px;
    margin: 22px 0 28px;
    padding: 18px;
    background: #111827;
    border: 1px solid #334155;
    border-radius: 12px;
}

/* Selector de dominios */
.domains-section .mail-filters select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 46px;
    box-sizing: border-box;
    padding: 0 38px 0 14px;
    background-color: #1e293b;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

/* Buscador */
.domains-section .mail-filters input[type="search"] {
    display: block;
    width: 100%;
    min-width: 0;
    height: 46px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 15px;
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
}

/* Resaltar controles seleccionados */
.domains-section .mail-filters select:focus,
.domains-section .mail-filters input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Botón Buscar */
.domains-section .mail-filters button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    box-sizing: border-box;
    padding: 0 24px;
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #3b82f6;
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.domains-section .mail-filters button[type="submit"]:hover {
    background: #1d4ed8;
}

/* Botón Limpiar */
.domains-section .mail-filters a[href="/mailcontrol/cuentas/"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    box-sizing: border-box;
    padding: 0 18px;
    background: #253247;
    color: #cbd5e1;
    border: 1px solid #475569;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.domains-section .mail-filters a[href="/mailcontrol/cuentas/"]:hover {
    background: #334155;
}

/* Adaptación para pantallas pequeñas */
@media (max-width: 1000px) {
    .domains-section form.mail-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 650px) {
    .domains-section .domains-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .domains-section .mail-create-actions {
        justify-content: flex-start;
    }

    .domains-section form.mail-filters {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .domains-section .mail-filters button,
    .domains-section .mail-filters a[href="/mailcontrol/cuentas/"] {
        width: 100%;
    }
}


/* MAILCONTROL - BOTONES FORMULARIO CREAR CUENTA */

.mail-create-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}

.mail-create-form .mail-create-actions button[type="submit"],
.mail-create-form .mail-create-actions a.mail-cancel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 145px;
    height: 46px;
    padding: 0 22px;
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mail-create-form .mail-create-actions button[type="submit"] {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #3b82f6;
}

.mail-create-form .mail-create-actions button[type="submit"]:hover {
    background: #1d4ed8;
}

.mail-create-form .mail-create-actions a.mail-cancel-button {
    background: #253247;
    color: #e2e8f0;
    border: 1px solid #475569;
}

.mail-create-form .mail-create-actions a.mail-cancel-button:hover {
    background: #334155;
}

@media (max-width: 480px) {
    .mail-create-form .mail-create-actions button[type="submit"],
    .mail-create-form .mail-create-actions a.mail-cancel-button {
        flex: 1;
        min-width: 0;
    }
}


/* ==========================================
   MAILCONTROL - SELECTORES PREMIUM
   ========================================== */

.mail-create-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    display: block;
    width: 100%;
    height: 52px;
    box-sizing: border-box;

    padding: 0 48px 0 18px;

    background-color: #172338;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

    background-repeat: no-repeat;
    background-position: right 17px center;
    background-size: 18px;

    color: #f1f5f9;

    border: 1px solid #334766;
    border-radius: 12px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

/* Efecto al pasar el cursor */
.mail-create-form select:hover {
    background-color: #1d2e49;
    border-color: #4f78b5;
}

/* Efecto al seleccionar */
.mail-create-form select:focus {
    outline: none;

    background-color: #1d2e49;
    border-color: #3b82f6;

    box-shadow:
        0 0 0 3px rgba(59, 130, 246, 0.15),
        0 4px 15px rgba(0, 0, 0, 0.12);
}

/* Opciones del menú */
.mail-create-form select option {
    background-color: #172338;
    color: #f1f5f9;
    font-size: 14px;
    padding: 12px;
}

/* Etiquetas */
.mail-create-form label {
    display: block;
    margin-top: 14px;
    margin-bottom: 3px;

    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Igualar diseño de campos de texto */
.mail-create-form input {
    height: 52px;
    border-radius: 12px;
    padding: 0 18px;
    background-color: #172338;
    border: 1px solid #334766;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.mail-create-form input:hover {
    border-color: #4f78b5;
}

.mail-create-form input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}


/* MAILCONTROL - ALINEACION FINAL DE FILTROS */

.domains-section form.mail-filters {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(240px, 1.6fr) 110px 100px;
    align-items: stretch;
    gap: 12px;
}

.domains-section form.mail-filters > select,
.domains-section form.mail-filters > input[type="search"],
.domains-section form.mail-filters > button[type="submit"],
.domains-section form.mail-filters > a {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    min-height: 46px;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    align-self: stretch;
    line-height: normal;
    vertical-align: middle;
}

/* Botón Buscar */
.domains-section form.mail-filters > button[type="submit"] {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 16px;
    padding-right: 16px;
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #3b82f6;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Botón Limpiar */
.domains-section form.mail-filters > a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 12px;
    padding-right: 12px;
    text-decoration: none;
}

/* Selector de dominios */
.domains-section form.mail-filters > select {
    padding-left: 14px;
    padding-right: 35px;
}

/* Campo de búsqueda */
.domains-section form.mail-filters > input[type="search"] {
    padding-left: 14px;
    padding-right: 14px;
}

/* Pantallas medianas */
@media (max-width: 1100px) {
    .domains-section form.mail-filters {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

/* Móviles */
@media (max-width: 650px) {
    .domains-section form.mail-filters {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* MAILCONTROL - ADMINISTRAR CUENTAS */

.mail-manage-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #1e3a5f;
    border: 1px solid #3b82f6;
    border-radius: 9px;
    color: #bfdbfe !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
}

.mail-manage-button:hover {
    background: #2563eb;
    color: #ffffff !important;
}

.mail-manage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 25px;
}

.mail-manage-card {
    min-width: 0;
}

.mail-manage-card h3 {
    margin-bottom: 10px;
}

.mail-manage-card p {
    margin-bottom: 20px;
    color: #94a3b8;
    font-size: 13px;
}

.mail-manage-back {
    margin-top: 25px;
}

.mail-manage-back a {
    color: #93c5fd;
    text-decoration: none;
}

@media (max-width: 850px) {
    .mail-manage-grid {
        grid-template-columns: 1fr;
    }
}

/* MAILCONTROL - CUOTA ACTUAL */

.mail-current-quota {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 16px;
    margin-bottom: 18px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    color: #93c5fd;
    font-size: 15px;
    font-weight: 600;
}


/* MAILCONTROL - DETALLES DE ALMACENAMIENTO */

.mail-storage-details {
    display: grid;
    gap: 12px;
    margin: 18px 0 24px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 12px;
}

.mail-storage-details > div:not(.mail-storage-progress) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mail-storage-details span {
    color: #94a3b8;
    font-size: 13px;
}

.mail-storage-details strong {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
}

.mail-storage-progress {
    display: block;
    width: 100%;
    height: 9px;
    margin-top: 5px;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    accent-color: #3b82f6;
}

.mail-storage-progress::-webkit-progress-bar {
    background: #1e293b;
    border-radius: 10px;
}

.mail-storage-progress::-webkit-progress-value {
    background: #3b82f6;
    border-radius: 10px;
}



/* MAILCONTROL - SUSPENDER / REACTIVAR */

.mail-status-card {
    margin-top: 22px;
}

.mail-account-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 17px;
    margin: 18px 0;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
}

.mail-account-status span {
    color: #94a3b8;
    font-size: 14px;
}

.mail-status-active {
    color: #22c55e;
}

.mail-status-suspended {
    color: #f87171;
}

.mail-status-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}

.mail-confirm-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
}

.mail-confirm-check input {
    margin-top: 2px;
    accent-color: #3b82f6;
}

.mail-suspend-button,
.mail-reactivate-button {
    padding: 12px 20px;
    border: 0;
    border-radius: 9px;
    font-weight: 600;
    cursor: pointer;
}

.mail-suspend-button {
    background: #991b1b;
    color: #ffffff;
}

.mail-suspend-button:hover {
    background: #b91c1c;
}

.mail-reactivate-button {
    background: #15803d;
    color: #ffffff;
}

.mail-reactivate-button:hover {
    background: #16a34a;
}

/* MAILCONTROL - CORRECCION CHECKBOX CONFIRMACION */

.mail-status-form .mail-confirm-check {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: fit-content;
    max-width: 100%;
    gap: 10px;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.mail-status-form .mail-confirm-check input[type="checkbox"] {
    appearance: auto;
    -webkit-appearance: checkbox;
    display: inline-block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    accent-color: #3b82f6;
    cursor: pointer;
}

.mail-status-form .mail-confirm-check span {
    display: inline;
    flex: 0 1 auto;
    width: auto;
    margin: 0;
    padding: 0;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.5;
}


/* MAILCONTROL - BOTONES EN PROCESAMIENTO */

button.mail-processing {
    opacity: 0.65 !important;
    cursor: wait !important;
    pointer-events: none !important;
    transition: opacity 0.2s ease;
}




/* =====================================================
   MAILCONTROL — AUDITORÍA
   ===================================================== */

.audit-card {
    margin-bottom: 24px;
    padding: 28px;
    min-width: 0;
}

.audit-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.audit-section-heading h3 {
    margin: 0 0 7px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.35px;
}

.audit-section-heading p {
    margin: 0;
    font-size: 13px;
    color: #718096;
}

.audit-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: end;
}

.audit-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.audit-field label {
    font-size: 12px;
    font-weight: 650;
    color: #475569;
}

.audit-field input,
.audit-field select {
    width: 100%;
    height: 46px;
    min-width: 0;
    padding: 0 14px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    background: #fff;
    color: #243247;
    font: inherit;
    font-size: 13px;
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.audit-field input:focus,
.audit-field select:focus {
    border-color: #5877e8;
    box-shadow: 0 0 0 3px rgba(88,119,232,.12);
}

.audit-field input::placeholder {
    color: #9aa7b8;
}

.audit-select-wrap {
    position: relative;
}

.audit-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    cursor: pointer;
}

.audit-select-wrap::after {
    content: "";
    position: absolute;
    right: 17px;
    top: 18px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    pointer-events: none;
}

.audit-filter-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    align-self: end;
    min-height: 46px;
}

.audit-button {
    height: 46px;
    padding: 0 22px;
    background: #3459d5;
    border: 0;
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .2s;
}

.audit-button:hover {
    background: #2547bd;
    transform: translateY(-1px);
}

.audit-clear {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
}

.audit-clear:hover {
    color: #3459d5;
}

.audit-count {
    padding: 9px 14px;
    background: #edf2ff;
    color: #3459d5;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.audit-table-scroll {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e8edf5;
    border-radius: 12px;
}

.audit-table {
    width: 100%;
    min-width: 1030px;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.audit-table thead {
    background: #f6f8fc;
}

.audit-table th {
    padding: 16px 14px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
    white-space: nowrap;
}

.audit-table td {
    padding: 16px 14px;
    border-top: 1px solid #edf1f6;
    vertical-align: middle;
    color: #334155;
}

.audit-table tbody tr {
    transition: background .15s;
}

.audit-table tbody tr:hover {
    background: #f8faff;
}

.audit-id {
    font-weight: 700;
    color: #64748b !important;
}

.audit-date,
.audit-ip {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.audit-user {
    font-weight: 700;
    color: #243247;
}

.audit-secondary {
    display: block;
    margin-top: 5px;
    color: #94a3b8;
    font-size: 11px;
}

.audit-badge {
    display: inline-block;
    padding: 7px 10px;
    background: #edf2ff;
    color: #3f5fca;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.audit-details {
    min-width: 210px;
    max-width: 350px;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.audit-empty {
    text-align: center;
    padding: 45px 20px !important;
    color: #94a3b8 !important;
}

.audit-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-top: 22px;
}

.audit-page-info {
    color: #64748b;
    font-size: 12px;
}

.audit-page-buttons {
    display: flex;
    gap: 10px;
}

.audit-page-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    background: white;
    color: #3459d5;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}

.audit-page-buttons a:hover {
    background: #edf2ff;
}

@media (max-width: 1100px) {
    .audit-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .audit-card {
        padding: 18px;
    }

    .audit-filters {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .audit-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .audit-filter-actions {
        flex-wrap: wrap;
    }

    .audit-pagination {
        flex-wrap: wrap;
    }
}

/* MAILCONTROL — AUDITORÍA: CONTRASTE Y ACABADOS */

.audit-field label {
    color: #b8c5dc;
    font-weight: 600;
}

.audit-table-scroll {
    border-color: #303c54;
    background: #192235;
}

.audit-table thead {
    background: #26334b;
}

.audit-table th {
    color: #c1cde0;
    border-bottom: 1px solid #394760;
}

.audit-table td {
    color: #e2e8f4;
    border-top: 1px solid #303c54;
}

.audit-table tbody tr:hover {
    background: #23314b;
}

.audit-table .audit-id {
    color: #9fb3d4 !important;
}

.audit-table .audit-user {
    color: #f1f5ff;
}

.audit-table .audit-secondary {
    color: #a3b2cc;
}

.audit-table .audit-date,
.audit-table .audit-ip {
    color: #c7d3e7;
}

.audit-table .audit-details {
    color: #dce5f5;
}

.audit-table .audit-empty {
    color: #a3b2cc !important;
}

.audit-section-heading p,
.audit-page-info {
    color: #a5b4cc;
}

.audit-clear {
    color: #b8c5dc;
}

.audit-clear:hover {
    color: #ffffff;
}

.audit-count {
    background: #263d72;
    color: #bcd1ff;
}

.audit-badge {
    background: #293e70;
    color: #bcd1ff;
}

.audit-page-buttons a {
    background: #202c43;
    border-color: #394760;
    color: #c8d8ff;
}

.audit-page-buttons a:hover {
    background: #304366;
}



/* =====================================================
   MAILCONTROL — AUDITORÍA: AJUSTES FINALES
   ===================================================== */

.audit-field input[type="date"] {
    color-scheme: light;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.audit-field input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: .65;
    transition: opacity .2s;
}

.audit-field input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.audit-field input[type="date"]:focus {
    border-color: #5877e8;
    box-shadow: 0 0 0 3px rgba(88,119,232,.12);
}

.audit-table .audit-date {
    color: #dbe5f5;
    font-weight: 500;
    letter-spacing: .1px;
}

.audit-table .audit-badge {
    white-space: normal;
    line-height: 1.4;
    text-align: center;
}

.audit-field select option {
    color: #243247;
    background: #ffffff;
}

.audit-table tbody tr:last-child td {
    border-bottom: none;
}


/* ====================================================
   MAILCONTROL - CORRECCIÓN VISUAL DE MI PERFIL
   ==================================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
}

.sidebar .sidebar-bottom {
    margin-top: auto;
    padding-top: 24px;
    padding-bottom: 20px;
}

.sidebar .sidebar-bottom a.profile-logout {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    border-radius: 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .2s, color .2s;
}

.sidebar .sidebar-bottom a.profile-logout:hover {
    background: rgba(239, 68, 68, .12);
    color: #f87171;
}

.profile-help {
    color: #94a3b8;
    font-size: 13px;
    margin: 8px 0 16px;
}

@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }

    .sidebar .sidebar-bottom {
        margin-top: 16px;
        padding-bottom: 12px;
    }
}


/* Botón Administrar - MailControl */
.admin-manage-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    min-height: 42px;
    box-sizing: border-box;
    background: #2563eb;
    color: #ffffff !important;
    border: 1px solid #3b82f6;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease,
                box-shadow .2s ease;
}

.admin-manage-button:hover {
    background: #1d4ed8;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, .25);
}

.admin-manage-button:active {
    transform: translateY(0);
}

.admin-manage-button:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 3px;
}


/* ====================================================
   MC SETTINGS V2 - CONFIGURACION PREMIUM
   Estilos aislados de otras paginas de MailControl
   ==================================================== */

.mc-settings-v2 {
    min-width: 0;
    max-width: 1600px;
}

.mc-settings-v2 .topbar {
    margin-bottom: 28px;
}

.mc-settings-v2 .topbar h2 {
    font-size: 29px;
    letter-spacing: -0.8px;
}

.mc-eyebrow,
.mc-section-kicker {
    display: block;
    color: #60a5fa;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.mc-settings-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 42px;
    border-radius: 20px;
    background:
        radial-gradient(
            circle at 90% 15%,
            rgba(59,130,246,.25),
            transparent 40%
        ),
        linear-gradient(120deg,#172554,#142039 75%);
    border: 1px solid #2b4775;
}

.mc-settings-hero h1 {
    margin: 17px 0;
    font-size: clamp(28px,3vw,42px);
    line-height: 1.17;
    letter-spacing: -1.4px;
}

.mc-settings-hero h1 span {
    display: block;
    color: #93c5fd;
}

.mc-settings-hero p {
    max-width: 570px;
    color: #b9cae4;
    line-height: 1.7;
    margin: 0;
    font-size: 14px;
}

.mc-hero-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    border: 1px solid rgba(147,197,253,.22);
    border-radius: 30px;
    color: #bfdbfe;
    background: rgba(15,23,42,.36);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.mc-live-dot {
    width: 7px;
    height: 7px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 12px #34d399;
}

.mc-hero-badge {
    width: 170px;
    min-width: 170px;
    height: 170px;
    border: 1px solid rgba(147,197,253,.2);
    border-radius: 24px;
    background: rgba(15,23,42,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
}

.mc-hero-badge-symbol {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: #2563eb;
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 7px;
}

.mc-hero-badge strong {
    font-size: 15px;
}

.mc-hero-badge small {
    color: #93a8c7;
    font-size: 11px;
}

.mc-settings-summary {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 15px;
    margin: 20px 0 38px;
}

.mc-summary-item {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 0;
    padding: 22px;
    background: #172033;
    border: 1px solid #29364d;
    border-radius: 15px;
}

.mc-summary-icon {
    flex: 0 0 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #1e3a5f;
    color: #93c5fd;
    font-size: 22px;
}

.mc-summary-item small {
    display: block;
    color: #899bb8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.mc-summary-item strong {
    display: block;
    color: #f1f5f9;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.mc-summary-item .mc-secure {
    color: #6ee7b7;
}

.mc-settings-section {
    margin-top: 35px;
}

.mc-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 19px;
}

.mc-section-heading h2 {
    font-size: 22px;
    margin: 0 0 8px;
    letter-spacing: -.5px;
}

.mc-section-heading p {
    color: #94a3b8;
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.mc-count-pill {
    flex-shrink: 0;
    border: 1px solid #2e4568;
    background: #16243a;
    color: #bfdbfe;
    padding: 9px 13px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
}

.mc-domain-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 13px;
}

.mc-domain-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 19px;
    background: #172033;
    border: 1px solid #29364d;
    border-radius: 13px;
    transition: border-color .2s,background .2s;
}

.mc-domain-card:hover {
    background: #1b2940;
    border-color: #426394;
}

.mc-domain-icon {
    flex: 0 0 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #1a3659;
    color: #7dd3fc;
    font-size: 25px;
}

.mc-domain-details {
    min-width: 0;
    flex: 1;
}

.mc-domain-details strong {
    display: block;
    font-size: 14px;
    color: #e2e8f0;
    overflow-wrap: anywhere;
}

.mc-domain-details small {
    display: block;
    margin-top: 6px;
    color: #8293ad;
    font-size: 11px;
}

.mc-domain-check {
    color: #6ee7b7;
    font-weight: 800;
}

.mc-action-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 13px;
}

.mc-settings-v2 a.mc-action-card,
.mc-settings-v2 a.mc-action-card:visited {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    min-height: 106px;
    padding: 21px;
    border-radius: 14px;
    border: 1px solid #29364d;
    background: #172033;
    color: #f1f5f9;
    text-decoration: none;
    transition:
        transform .18s,
        border-color .18s,
        background .18s;
}

.mc-settings-v2 a.mc-action-card:hover {
    transform: translateY(-2px);
    background: #1c2b43;
    border-color: #3b82f6;
}

.mc-settings-v2 a.mc-action-card:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
}

.mc-action-icon {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 25px;
    font-weight: 700;
}

.mc-blue   {background:#1c3968;color:#93c5fd}
.mc-purple {background:#33265b;color:#c4b5fd}
.mc-cyan   {background:#163f4e;color:#67e8f9}
.mc-amber  {background:#493718;color:#fcd34d}
.mc-green  {background:#153f35;color:#6ee7b7}

.mc-action-body {
    flex: 1;
    min-width: 0;
}

.mc-action-body strong {
    display: block;
    font-size: 15px;
    margin-bottom: 8px;
    color: #f1f5f9;
}

.mc-action-body small {
    display: block;
    font-size: 12px;
    line-height: 1.5;
    color: #94a3b8;
}

.mc-action-arrow {
    font-size: 22px;
    color: #93c5fd;
}

.mc-settings-empty {
    color: #94a3b8;
    padding: 28px;
    background: #172033;
    border-radius: 12px;
}

.mc-settings-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 45px;
    padding: 20px 0;
    border-top: 1px solid #253044;
    color: #64748b;
    font-size: 12px;
}

.mc-settings-footer span:first-child {
    color: #94a3b8;
    font-weight: 800;
}

@media (max-width:1100px) {
    .mc-domain-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .mc-settings-summary {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media (max-width:760px) {
    .mc-settings-hero {
        padding: 26px;
    }

    .mc-hero-badge {
        display: none;
    }

    .mc-settings-summary,
    .mc-domain-grid,
    .mc-action-grid {
        grid-template-columns: 1fr;
    }

    .mc-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .mc-settings-footer {
        flex-direction: column;
    }

    .mc-settings-v2 {
        padding: 22px 15px;
    }
}

@media (prefers-reduced-motion:reduce) {
    .mc-domain-card,
    .mc-settings-v2 a.mc-action-card {
        transition: none;
    }
}

/* END MC SETTINGS V2 */


/* MC SETTINGS V3 - refinamiento visual */
.mc-settings-v2 .mc-settings-hero {
    padding: 28px 34px;
}
.mc-settings-v2 .mc-settings-hero h1 {
    margin: 12px 0;
    font-size: clamp(26px, 2.8vw, 36px);
}
.mc-settings-v2 .mc-hero-badge {
    width: 132px;
    min-width: 132px;
    height: 132px;
}
.mc-settings-v2 .mc-settings-summary {
    margin-top: 16px;
    margin-bottom: 28px;
}
.mc-settings-v2 .mc-summary-item {
    padding: 18px;
}
.mc-settings-v2 .mc-domain-icon svg,
.mc-settings-v2 .mc-summary-icon svg,
.mc-settings-v2 .mc-action-icon svg,
.mc-settings-v2 .mc-domain-check svg {
    display: block;
}
.mc-settings-v2 .mc-domain-check svg {
    width: 17px;
    height: 17px;
}
.mc-settings-v2 .mc-action-card {
    min-height: 94px;
}
@media (max-width:760px) {
    .mc-settings-v2 .mc-settings-hero {
        padding: 24px;
    }
}
/* END MC SETTINGS V3 */


/* MAILCONTROL - INDICADOR DE ALMACENAMIENTO EN LISTADO (v1) */
.domains-table th:nth-child(3),
.domains-table td.mc-storage-cell { min-width: 210px; width: 23%; }
.mc-storage-cell { vertical-align: middle; }
.mc-storage-caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; font-size: 12px; line-height: 1.35; }
.mc-storage-caption span { color: #a9b8d0; white-space: nowrap; }
.mc-storage-caption strong { color: #f1f5f9; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mc-storage-track { width: 100%; height: 8px; overflow: hidden; border-radius: 999px; background: #303e55; }
.mc-storage-track > span { display: block; height: 100%; border-radius: inherit; transition: width .25s ease; }
.mc-storage-ok > span { background: #10b981; }
.mc-storage-warning > span { background: #f59e0b; }
.mc-storage-danger > span { background: #ef4444; }
.mc-storage-unlimited > span { width: 100%; background: repeating-linear-gradient(90deg, #3b82f6 0, #3b82f6 10px, #24466f 10px, #24466f 15px); }
.mc-storage-unknown > span { width: 0; }
.mc-storage-muted { color: #94a3b8; font-size: 12px; }
@media (max-width: 1000px) { .domains-table { min-width: 960px; } }
/* END MAILCONTROL - ALMACENAMIENTO */

.mc-storage-progress { display: block; width: 100%; height: 8px; margin: 0; border: 0; border-radius: 999px; overflow: hidden; appearance: none; -webkit-appearance: none; background: #303e55; }
.mc-storage-progress::-webkit-progress-bar { background: #303e55; border-radius: 999px; }
.mc-storage-progress::-webkit-progress-value { border-radius: 999px; background: #10b981; }
.mc-storage-progress::-moz-progress-bar { border-radius: 999px; background: #10b981; }
.mc-storage-progress.mc-storage-warning::-webkit-progress-value { background: #f59e0b; }
.mc-storage-progress.mc-storage-warning::-moz-progress-bar { background: #f59e0b; }
.mc-storage-progress.mc-storage-danger::-webkit-progress-value { background: #ef4444; }
.mc-storage-progress.mc-storage-danger::-moz-progress-bar { background: #ef4444; }


/* MailControl: navegación lateral consistente, visible en páginas extensas. */
@media (min-width: 769px) {
    .dashboard > .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 255px;
        min-height: 0;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        z-index: 50;
    }
    .dashboard > .main {
        margin-left: 255px;
        min-width: 0;
        width: calc(100% - 255px);
    }
}
.dashboard > .sidebar { flex-shrink: 0; }
.dashboard > .sidebar .sidebar-bottom { margin-top: auto; padding-top: 12px; padding-bottom: 0; }
.dashboard > .sidebar .sidebar-bottom form { margin: 0; }
.dashboard > .sidebar .sidebar-bottom button { margin-top: 0; }
@media (max-width: 768px) {
    .dashboard > .sidebar {
        position: sticky;
        top: 0;
        align-self: flex-start;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow-y: auto;
    }
    .dashboard > .main { min-width: 0; }
}


/* MailControl - Botón Eliminar usuario */
button.mail-delete-danger,
.mail-create-actions button.mail-delete-danger {
    background: #dc2626 !important;
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #ef4444 !important;
}

button.mail-delete-danger:hover,
.mail-create-actions button.mail-delete-danger:hover {
    background: #b91c1c !important;
    background-color: #b91c1c !important;
}

/* RC3: Layout de administración de correo. Evita colapso de columnas y
   desplazamiento horizontal provocado por reglas globales de flex/grid. */
.dashboard > main.main {
    box-sizing: border-box;
    min-width: 0;
    max-width: none;
}
.mail-manage-grid {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}
.mail-manage-grid > .mail-manage-card {
    min-width: 0;
    width: 100%;
    max-width: none;
    overflow-wrap: anywhere;
}
.mail-manage-grid .mail-create-form,
.mail-manage-grid .mail-create-form input,
.mail-manage-grid .mail-create-form select,
.mail-manage-grid .mail-create-actions {
    min-width: 0;
    max-width: 100%;
}
@media (min-width: 769px) {
    .dashboard > main.main {
        flex: 0 0 calc(100% - 255px);
        width: calc(100% - 255px);
        margin-left: 255px;
    }
}
@media (max-width: 1100px) {
    .mail-manage-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .dashboard > main.main { flex: 1 1 auto; width: 100%; margin-left: 0; }
}


/* MAILCONTROL RESPONSIVE UNIFICADO RC6 */

*, *::before, *::after {
    box-sizing: border-box;
}

@media (max-width: 1023px) {

    html, body {
        margin: 0;
        width: 100%;
        overflow-x: clip;
    }

    .dashboard {
        display: block !important;
        width: 100%;
        min-width: 0;
    }

    /* Contenido principal */
    .dashboard > .main,
    .dashboard > main.main {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 96px 16px 32px !important;
    }


    /* Checkbox de navegación */
    .dashboard > #mc-nav-toggle {
        position: fixed !important;
        opacity: 0 !important;
        width: 1px !important;
        height: 1px !important;
        pointer-events: none !important;
    }

    /* Botón hamburguesa */
    .dashboard > .mc-nav-trigger {
        display: flex !important;
        position: fixed !important;

        top: 12px !important;
        left: 16px !important;

        width: 44px !important;
        height: 44px !important;

        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;
        gap: 5px !important;

        background: #1e3a5f !important;
        border: 1px solid #334155 !important;
        border-radius: 11px !important;

        z-index: 1200 !important;
        cursor: pointer !important;
    }

    .dashboard > .mc-nav-trigger span {
        display: block !important;
        width: 20px !important;
        height: 2px !important;
        background: #fff !important;
        border-radius: 2px !important;
        transition: transform .2s, opacity .2s;
    }

    /* Menú lateral */
    .dashboard > .sidebar {
        position: fixed !important;

        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;

        width: min(320px, 86vw) !important;
        max-width: 86vw !important;
        height: 100vh !important;
        height: 100dvh !important;

        padding: 24px 18px !important;

        margin: 0 !important;
        overflow-y: auto !important;

        z-index: 1100 !important;

        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 8px 0 30px rgba(0,0,0,.25);
    }

    /* Logotipo original */
    .dashboard > .sidebar .brand {
        display: flex !important;
        align-items: center !important;
        padding-left: 0 !important;
        padding-right: 48px !important;
        min-height: 48px !important;
        margin-bottom: 28px !important;
        white-space: nowrap;
    }

    .dashboard > .sidebar .brand-icon {
        display: inline-block !important;
        margin-right: 10px !important;
    }

    /* Menú abierto */
    .dashboard:has(#mc-nav-toggle:checked) > .sidebar {
        transform: translateX(0) !important;
    }

    /* Botón a la derecha cuando el menú está abierto */
    .dashboard:has(#mc-nav-toggle:checked) > .mc-nav-trigger {
        left: min(calc(86vw - 60px), 260px) !important;
        top: 12px !important;
        background: #263247 !important;
    }

    /* Convertir hamburguesa en X */
    .dashboard:has(#mc-nav-toggle:checked)
    > .mc-nav-trigger span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .dashboard:has(#mc-nav-toggle:checked)
    > .mc-nav-trigger span:nth-child(2) {
        opacity: 0;
    }

    .dashboard:has(#mc-nav-toggle:checked)
    > .mc-nav-trigger span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Fondo oscuro */
    .dashboard > .mc-nav-backdrop {
        display: none !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0,0,0,.6) !important;
        z-index: 1050 !important;
    }

    .dashboard:has(#mc-nav-toggle:checked) > .mc-nav-backdrop {
        display: block !important;
    }

    /* Contenido responsive */
    .dashboard .card,
    .dashboard .panel,
    .dashboard .stat-card,
    .dashboard .form-card {
        max-width: 100%;
        min-width: 0;
    }

    .dashboard input,
    .dashboard select,
    .dashboard textarea {
        max-width: 100%;
        min-width: 0;
    }

    .dashboard .table-responsive,
    .dashboard .table-wrapper {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 767px) {

    .dashboard > .main,
    .dashboard > main.main {
        padding: 92px 14px 28px !important;
    }

    .dashboard h1 {
        font-size: clamp(23px, 6vw, 30px);
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .dashboard h2 {
        font-size: clamp(19px, 5vw, 24px);
        line-height: 1.25;
    }

    .dashboard .grid,
    .dashboard .stats-grid,
    .dashboard .cards-grid,
    .dashboard .form-grid,
    .dashboard .two-columns,
    .dashboard .two-column {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .dashboard input,
    .dashboard select,
    .dashboard textarea {
        font-size: 16px;
    }
}

@media (min-width: 1024px) {
    .dashboard > .mc-nav-trigger,
    .dashboard > .mc-nav-backdrop,
    .dashboard > #mc-nav-toggle {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard > .sidebar,
    .dashboard > .mc-nav-trigger span {
        transition: none !important;
    }
}


/* MAILCONTROL MOBILE HEADER DEFINITIVO RC6 */

.mc-mobile-header {
    display: none;
}

@media (max-width: 1023px) {

    .dashboard::before {
        display: none !important;
        content: none !important;
    }

    .dashboard > .mc-mobile-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;

        height: 72px !important;

        display: flex !important;
        align-items: center !important;
        gap: 10px !important;

        padding: 0 16px 0 76px !important;

        background: #0b1220 !important;
        border-bottom: 1px solid #253044 !important;

        z-index: 1000 !important;
    }

    .mc-mobile-logo {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        flex: 0 0 38px !important;
        width: 38px !important;
        height: 38px !important;

        background: #2563eb !important;
        color: #ffffff !important;

        border-radius: 9px !important;

        font-size: 21px !important;
        font-weight: 800 !important;
    }

    .mc-mobile-name {
        color: #f8fafc !important;
        font-size: 19px !important;
        font-weight: 750 !important;
        white-space: nowrap !important;
    }

    .dashboard > .mc-nav-trigger {
        top: 14px !important;
        left: 14px !important;

        width: 44px !important;
        height: 44px !important;

        z-index: 1200 !important;
    }

    .dashboard:has(#mc-nav-toggle:checked) > .mc-nav-trigger {
        top: 14px !important;
        left: min(calc(86vw - 60px), 260px) !important;
    }

    .dashboard > .sidebar .brand {
        padding-left: 0 !important;
        padding-right: 48px !important;
    }

    .dashboard > .sidebar .brand-icon {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        width: 44px !important;
        height: 44px !important;

        padding: 0 !important;
        margin-right: 10px !important;
    }
}

@media (min-width: 1024px) {
    .dashboard > .mc-mobile-header {
        display: none !important;
    }
}


/* MAILCONTROL TABLET HEADER ALIGNMENT RC7 */

/*
 * Solo tablets y laptops pequeñas.
 * No modifica iPhone ni escritorio >= 1024px.
 */

@media (min-width: 768px) and (max-width: 1023px) {

    /* Encabezado: todos los elementos centrados */
    .dashboard > .mc-mobile-header {
        height: 72px !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 0 20px 0 90px !important;
    }

    /* Logotipo M */
    .dashboard > .mc-mobile-header .mc-mobile-logo {
        width: 44px !important;
        height: 44px !important;
        flex: 0 0 44px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        margin: 0 !important;
    }

    /* Nombre MailControl */
    .dashboard > .mc-mobile-header .mc-mobile-name {
        display: inline-flex !important;
        align-items: center !important;

        height: 44px !important;
        margin: 0 !important;
        line-height: 1 !important;
    }

    /* Hamburguesa: centrada respecto a la M */
    .dashboard > .mc-nav-trigger {
        position: fixed !important;

        top: 14px !important;
        left: 14px !important;

        width: 44px !important;
        height: 44px !important;

        margin: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;

        z-index: 1200 !important;
    }

    /* Mantener alineado el botón cuando abre el menú */
    .dashboard:has(#mc-nav-toggle:checked) > .mc-nav-trigger {
        top: 14px !important;
        left: min(calc(86vw - 60px), 260px) !important;
    }
}


/* MAILCONTROL CREATE ACCOUNT RESPONSIVE RC8 */

/* Tablets y móviles */
@media (max-width: 1023px) {

    /* Encabezado superior */
    .dashboard > .mc-mobile-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;

        height: 72px !important;

        display: flex !important;
        align-items: center !important;
        gap: 12px !important;

        padding: 0 16px 0 76px !important;

        background: #0b1220 !important;
        border-bottom: 1px solid #253044 !important;

        z-index: 1000 !important;
    }

    /* Logo M */
    .dashboard > .mc-mobile-header .mc-mobile-logo {
        width: 44px !important;
        height: 44px !important;
        flex: 0 0 44px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    /* Nombre MailControl */
    .dashboard > .mc-mobile-header .mc-mobile-name {
        display: inline-flex !important;
        align-items: center !important;

        height: 44px !important;
        margin: 0 !important;

        font-size: 19px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    /* Hamburguesa alineada con logo y texto */
    .dashboard > .mc-nav-trigger {
        position: fixed !important;

        top: 14px !important;
        left: 14px !important;

        width: 44px !important;
        height: 44px !important;

        margin: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;

        z-index: 1200 !important;
    }

    /* Mantener el botón alineado cuando el menú se abre */
    .dashboard:has(#mc-nav-toggle:checked) > .mc-nav-trigger {
        top: 14px !important;
        left: min(calc(86vw - 60px), 260px) !important;
    }

    /* Contenido principal */
    .dashboard > main.main {
        padding-top: 94px !important;
    }

    /* Evitar desbordamientos */
    .dashboard > main.main,
    .dashboard > main.main * {
        box-sizing: border-box;
        min-width: 0;
    }
}

/* Ajustes específicos para móviles */
@media (max-width: 767px) {

    .dashboard > main.main {
        padding: 92px 14px 28px !important;
    }

    /* Formulario */
    .dashboard .mail-create-form {
        width: 100% !important;
        max-width: 100% !important;
    }

    .dashboard .mail-create-form input,
    .dashboard .mail-create-form select {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 16px !important;
    }

    /* Botones */
    .dashboard .mail-create-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .dashboard .mail-create-actions button,
    .dashboard .mail-create-actions .btn,
    .dashboard .mail-create-actions a {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 46px !important;
        margin: 0 !important;
    }
}

/* Tablets y laptops pequeñas */
@media (min-width: 768px) and (max-width: 1023px) {

    .dashboard > .mc-mobile-header {
        padding-left: 90px !important;
    }

    .dashboard > main.main {
        padding: 96px 20px 32px !important;
    }

    .dashboard .mail-create-form {
        max-width: 100% !important;
    }
}


/* MAILCONTROL CREATE BUTTON GREEN RC9 */

/* Botón de creación de cuenta */
.dashboard a.mc-create-green {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: fit-content !important;
    min-width: 220px !important;
    min-height: 48px !important;

    margin: 20px auto 28px !important;
    padding: 12px 26px !important;

    background: #16a34a !important;
    color: #ffffff !important;

    border: 1px solid #22c55e !important;
    border-radius: 12px !important;

    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;

    text-decoration: none !important;
    text-align: center !important;

    cursor: pointer !important;
    transition: background .2s ease, transform .2s ease !important;
}

/* Efecto al pasar el cursor */
@media (hover: hover) {
    .dashboard a.mc-create-green:hover {
        background: #15803d !important;
        border-color: #16a34a !important;
        transform: translateY(-1px);
    }
}

/* Efecto al presionar */
.dashboard a.mc-create-green:active {
    background: #166534 !important;
    transform: scale(.98);
}

/* Adaptación a iPhone */
@media (max-width: 767px) {
    .dashboard a.mc-create-green {
        width: 100% !important;
        max-width: 320px !important;
        min-width: 0 !important;
        margin: 18px auto 24px !important;
    }
}

/* MAILCONTROL ACCOUNTS HEADER RC15 - compact, scoped to accounts list */
.domains-section .domains-header { display:flex !important; flex-direction:row !important; align-items:center !important; justify-content:space-between !important; flex-wrap:wrap !important; gap:20px !important; margin-bottom:24px !important; }
.domains-section .domains-header > div:first-child { flex:1 1 260px !important; min-width:0 !important; }
.domains-section .domains-header h3 { margin-bottom:6px !important; }
.domains-section .domains-header p { margin-bottom:0 !important; }
.domains-section .mail-create-actions { display:flex !important; flex-direction:row !important; align-items:center !important; justify-content:flex-end !important; flex-wrap:wrap !important; width:auto !important; gap:12px !important; margin:0 !important; }
.domains-section .mail-create-actions .domains-count { display:inline-flex !important; align-items:center !important; justify-content:center !important; min-height:40px !important; padding:8px 14px !important; margin:0 !important; font-size:13px !important; font-weight:600 !important; line-height:1.2 !important; white-space:nowrap !important; }
.domains-section .mail-create-actions > a.mail-create-green-button { display:inline-flex !important; align-items:center !important; justify-content:center !important; box-sizing:border-box !important; width:auto !important; min-width:0 !important; max-width:100% !important; min-height:42px !important; margin:0 !important; padding:10px 15px !important; background:#16a34a !important; background-image:none !important; color:#fff !important; border:1px solid #22c55e !important; border-radius:10px !important; font-size:13px !important; font-weight:700 !important; line-height:1.2 !important; letter-spacing:0 !important; white-space:nowrap !important; text-align:center !important; text-decoration:none !important; box-shadow:0 3px 9px rgba(22,163,74,.14) !important; cursor:pointer !important; }
.domains-section .mail-create-actions > a.mail-create-green-button:hover { background:#15803d !important; border-color:#16a34a !important; color:#fff !important; }
.domains-section .mail-create-actions > a.mail-create-green-button:focus-visible { outline:3px solid #86efac !important; outline-offset:3px !important; }
@media(max-width:767px) { .domains-section .domains-header { flex-direction:column !important; align-items:stretch !important; gap:16px !important; margin-bottom:20px !important; } .domains-section .domains-header > div:first-child { flex:0 1 auto !important; width:100% !important; } .domains-section .mail-create-actions { width:100% !important; justify-content:space-between !important; gap:10px !important; } .domains-section .mail-create-actions .domains-count { min-height:38px !important; padding:7px 11px !important; font-size:12px !important; } .domains-section .mail-create-actions > a.mail-create-green-button { min-height:42px !important; padding:10px 14px !important; font-size:13px !important; } }
@media(max-width:360px) { .domains-section .mail-create-actions { justify-content:flex-start !important; } }

/* RC16: selector multidominio */
.mc-domain-choices{display:grid;gap:10px;border:1px solid #334155;border-radius:12px;padding:16px;margin:16px 0;}
.mc-domain-choices legend{padding:0 8px;font-weight:700;}
.mc-domain-choices label{display:flex;align-items:center;gap:10px;cursor:pointer;}
.mc-domain-choices input[type=checkbox]{width:18px;height:18px;flex:none;}
