@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
    --primary-color: #0d6efd;
    --mercadopago-color: #009ee3;
    --success-color: #198754;
    --error-color: #dc3545;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --border-color: #dee2e6;
    --shadow: 0 4px 8px rgba(0,0,0,0.1);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 0 15px; /* Añadir padding horizontal para móviles */
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: center; /* Centrar el contenido del header */
    align-items: center;
    margin-bottom: 30px;
    text-align: center; /* Centrar texto por defecto */
}

.header-main {
    display: flex;
    flex-direction: column; /* Apilar logo y título */
    align-items: center;
    gap: 10px; /* Espacio entre logo y título */
}

header h1 {
    margin: 0;
    font-size: 1.7em; /* Un punto más pequeño que 1.8em */
    color: var(--dark-gray);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notification-wrapper {
    position: relative;
}

.notification-bell {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    position: relative;
}

.notification-bell svg {
    width: 28px;
    height: 28px;
    fill: #6c757d;
}

.notification-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--error-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.notification-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-width: 90vw; /* Asegurar que no se desborde en pantallas pequeñas */
    max-height: 400px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 1001;
}

.notification-panel-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.notification-panel-header h3 {
    margin: 0;
    font-size: 1.1em;
}

.notification-list {
    padding: 0;
    margin: 0;
}

.notification-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e9f5ff;
    font-weight: bold;
}

.notification-item p {
    margin: 0 0 5px 0;
    font-size: 0.95em;
}

.notification-item .timestamp {
    font-size: 0.8em;
    color: #6c757d;
}


.logo {
    max-width: 180px; /* Reajustamos el tamaño del logo */
    margin-bottom: 0;
    flex-shrink: 0; /* Evita que el logo se encoja */
}

h1 {
    /* Estilos del h1 ahora están en .header-center-title */
}

.card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.phone-input-group {
    display: flex;
    gap: 10px;
}
.phone-input-group select {
    flex-basis: 120px;
    flex-shrink: 0;
}
.phone-input-group input {
    flex-grow: 1;
}

#form-upload .input-group input[type="file"] {
    padding: 10px;
    border: 1px dashed var(--border-color);
    background-color: #f8f9fa;
    cursor: pointer;
}

.btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    text-decoration: none; /* Quitar subrayado de los links */
    transition: background-color 0.3s, transform 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.btn .btn-text {
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.btn .loader {
    position: absolute;
}

.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }

.btn:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.65;
}
.btn:disabled:hover {
    opacity: 0.65; /* Evitar cambio de opacidad en hover */
}

.btn-primary { background-color: var(--primary-color); }
.btn-success { background-color: var(--success-color); }
.btn-secondary { background-color: #6c757d; }
.btn-secondary:hover { background-color: #5c636a; }
.btn-info { background-color: var(--primary-color); } /* Cambiado a azul */
.btn-danger { background-color: var(--error-color); }

.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mensaje {
    padding: 15px;
    margin-top: 20px;
    border-radius: 8px;
    text-align: center;
}
.error { background-color: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.success { background-color: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.info { background-color: #cff4fc; color: #055160; border: 1px solid #b6effb; }

footer {
    text-align: center;
    margin-top: 30px;
    color: #6c757d;
    font-size: 0.9em;
}

/* --- ESTILOS DEL PORTAL DE CLIENTES --- */
#lista-cuentas {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}
.cuenta-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative; /* Necesario para posicionar el badge */
}

.cuenta-notification-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    z-index: 2;
}

.cuenta-notification-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--primary-color);
}

.cuenta-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--error-color);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.cuenta-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.cuenta-item h3 { margin: 0 0 10px 0; color: var(--primary-color); }
.cuenta-item p { margin: 0; color: #6c757d; }

.dashboard-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
}
.pago-container {
    margin-top: 30px;
}
.dashboard-column {
    flex: 1 1 320px; /* Permite crecer y encogerse con una base de 320px */
}

/* Ajuste para la flexibilidad de las columnas superiores */
#columna-datos-cuenta {
    flex-grow: 2; /* Le da más prioridad para crecer */
    flex-shrink: 1;
}
#columna-resumen-pago {
    flex-grow: 1;
    flex-shrink: 2; /* Se encogerá más fácilmente si es necesario */
    min-width: 280px; /* Asegura que no se colapse por completo */
}

.dashboard-column-full {
    flex-basis: 100%;
}
.apartado {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.apartado-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.apartado-header h3 {
    margin: 0;
    font-size: 1.2em;
    color: var(--primary-color);
}
.apartado-body {
    padding: 20px;
    flex-grow: 1;
}

.apartado-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: #f8f9fa;
}

.apartado-body p:first-child {
    margin-top: 0;
}
#datos-cuenta-content .dato-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
#datos-cuenta-content .dato-item:last-child {
    border-bottom: none;
}
#datos-cuenta-content .dato-titulo {
    font-weight: 500;
    color: #6c757d;
    margin-right: 15px;
}
#datos-cuenta-content .dato-valor {
    color: var(--dark-gray);
    text-align: right;
    font-weight: 500;
}
.footer-acciones {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}
.btn-volver {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}
.btn-volver:hover {
    background-color: #157347;
}
.btn-volver-rojo {
    background-color: var(--error-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s;
}
.btn-volver-rojo:hover {
    background-color: #b02a37;
}

#estado-cuenta-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; /* Cambiado a space-between */
    align-items: center;
    gap: 15px;
    /* margin-bottom ya no es necesario aquí */
}

#columna-datos-cuenta .apartado-header #estado-cuenta-content {
    margin-bottom: 0; /* Anular el margen que tenía antes */
}

.card-resumen-pago .apartado-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 15px;
}

.resumen-subtitulo {
    font-size: 1em;
    font-weight: 500;
    color: #6c757d;
    margin: 0;
}

.resumen-total {
    font-size: 2.8em;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.1;
}

.card-resumen-pago .btn {
    width: 100%;
    max-width: 250px; /* Para que no sea excesivamente ancho en desktop */
}

#mapa-container-fullwidth {
    width: 100%;
    height: 250px;
    border-radius: 8px;
    margin-top: 30px;
}


#estado-cuenta-content .estado-item {
    display: inline-flex;
    align-items: center;
    font-size: 1em;
    font-weight: 500;
    margin-bottom: 0; /* Quitado para alinear con flex */
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid transparent;
}

#estado-cuenta-content .estado-icon {
    margin-right: 8px;
    font-size: 1.2em; /* Agrandamos un poco el emoji */
}

/* Estado: Activo (Verde) */
.estado-servicio-activo {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* Estado: Pendiente (Celeste) */
.estado-pendiente-de-activación {
    background-color: #cce5ff;
    color: #004085;
    border-color: #b8daff;
}

/* Estado: Advertencia (Naranja) */
.estado-servicio-con-falta-de-pago {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeeba;
}

/* Estado: Peligro (Rojo) */
.estado-bloqueo-de-servicio,
.estado-proceso-de-suspensión {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Estado: Inactivo (Gris) */
.estado-servicio-dado-de-baja,
.estado-estado-desconocido {
    background-color: #e2e3e5;
    color: #383d41;
    border-color: #d6d8db;
}

#mapa-container {
    display: none; /* Ocultamos el mapa original dentro de la tarjeta */
}

#lista-facturas {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}
.factura-item {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Distribute space between checkbox, info, and monto */
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease-in-out;
}

.factura-info {
    display: flex;
    flex-direction: column; /* Stack description and date vertically */
    flex-grow: 1; /* Allow info to take available space */
    margin-left: 15px; /* Space between checkbox and info */
}

.factura-vence {
    margin-left: 15px; /* Espacio entre fecha y vencimiento */
    font-style: italic;
    color: #6c757d;
}

.factura-monto {
    margin-left: 15px; /* Space between info and monto */
    /* Existing styles for color and font-weight */
}
.pedido-acciones {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}
.pedido-acciones select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}
.btn-guardar-pedido {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid var(--primary-color);
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 0.9em;
}
.btn-guardar-pedido:hover {
    opacity: 0.9;
}
.btn-ver-detalle {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #6c757d;
    background-color: #6c757d;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-ver-detalle:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.total-a-pagar {
    text-align: right;
    font-size: 1.5em;
    font-weight: 700;
    margin: 0; /* Quitado el margen superior e inferior */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}
.total-a-pagar span {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: 500;
}
.total-a-pagar strong {
    font-size: 1.2em;
    color: var(--dark-gray);
}


.status-container { text-align: center; padding: 20px 0; }
.status-icon { margin: 0 auto 20px auto; width: 80px; height: 80px; }
.status-icon svg { width: 100%; height: 100%; }
.status-success svg { fill: var(--success-color); }
.status-failure svg { fill: var(--error-color); }
.status-pending svg { fill: #ffc107; }

.consola-log {
    background-color: #212529;
    color: #f8f9fa;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    padding: 15px;
    border-radius: 8px;
    height: 300px;
    overflow-y: auto;
    white-space: pre-wrap; /* Clave para respetar saltos de línea */
    word-wrap: break-word;
    margin-top: 20px;
}

/* --- ESTILOS PARA LA PÁGINA DE GESTIÓN --- */
.back-to-dashboard {
    margin-bottom: 20px;
    text-align: left;
}
.back-to-dashboard a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
}
.back-to-dashboard a:hover {
    text-decoration: underline;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.dashboard-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 18px;
    text-decoration: none;
    color: var(--dark-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}
.dashboard-card h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: var(--primary-color);
}
.dashboard-card p {
    margin: 0;
    font-size: 0.85em;
    color: #6c757d;
    line-height: 1.5;
}
.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}
.card-icon svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}
.icon-portal { background-color: var(--primary-color); }
.icon-masivo { background-color: var(--success-color); }
.icon-debito { background-color: #ffc107; }
.icon-simulador { background-color: #fd7e14; }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px; /* Ajustado para consistencia */
    border-radius: 12px;
    position: relative;
    animation: slideIn 0.3s;
}

/* --- ESTILOS PARA EL MODAL DE QR --- */
.qr-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 25px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}
#qr-image {
    max-width: 220px;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
}
.qr-monto {
    font-size: 1.2em;
    font-weight: 500;
    margin-top: 15px;
}
.qr-monto strong {
    color: var(--primary-color);
    font-weight: 700;
}
.qr-info {
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
}


/* --- ESTILOS PARA EL CONTENIDO DEL MODAL DE PEDIDO --- */
.modal-content .container {
    padding: 0; /* Resetear padding para que no haya doble padding */
    max-width: 100%;
}

.modal-content .card {
    box-shadow: none;
    border: none;
    padding: 0;
}

.modal-content .pedido-header {
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
}

.modal-content .pedido-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--primary-color);
}

.modal-content .pedido-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.modal-content .info-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.modal-content .info-item strong {
    display: block;
    color: #6c757d;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.modal-content .info-item span {
    font-weight: 500;
    font-size: 1.1em;
}

.modal-content .pedido-articulos h3 {
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-content .articulos-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.modal-content .articulos-table th,
.modal-content .articulos-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.modal-content .articulos-table th {
    background-color: #f8f9fa;
    font-weight: 700;
}

.modal-content .articulos-table .text-right {
    text-align: right;
}

.modal-content .pedido-total {
    text-align: right;
    font-size: 1.4em;
    font-weight: 700;
    margin-top: 20px;
}

.modal-content .pedido-total span {
    color: var(--success-color);
}

.modal-content .footer-acciones {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* --- Media Queries para el modal --- */
@media (max-width: 768px) {
    .modal-content .pedido-info {
        grid-template-columns: 1fr; /* Una columna en móviles */
    }

    .modal-content .articulos-table {
        display: block;
        width: 100%;
    }
    .modal-content .articulos-table thead,
    .modal-content .articulos-table tbody,
    .modal-content .articulos-table tr {
        display: block;
    }

    .modal-content .articulos-table thead {
        display: none; /* Ocultar cabecera */
    }

    .modal-content .articulos-table tr {
        border: 1px solid var(--border-color);
        margin-bottom: 15px;
    }

    .modal-content .articulos-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px;
        border: none;
        border-bottom: 1px solid #f0f0f0;
    }
    .modal-content .articulos-table td:last-child {
        border-bottom: none;
    }

    .modal-content .articulos-table td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 10px;
    }

    .modal-content .articulos-table .text-right {
        text-align: left; /* Forzar alineación para que el flexbox funcione */
    }

    .modal-content .pedido-total {
        text-align: center;
        font-size: 1.6em;
    }
}


.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 15px;
    right: 25px;
}

.modal-close:hover,
.modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {opacity: 0}
    to {opacity: 1}
}

@keyframes slideIn {
    from {top: -50px; opacity: 0}
    to {top: 0; opacity: 1}
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20% auto;
    }
}

.progress-bar-container { /* ... (estilos existentes) ... */ }
.progress-bar { /* ... */ }
.progress-bar-container span { /* ... */ }

.download-area {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.download-area .btn {
    width: auto;
}

.button-group.payment-buttons {
    display: flex;
    gap: 15px; /* Espacio entre los botones */
}
.button-group.payment-buttons .btn {
    flex: 1 1 0; /* Cada botón ocupa el mismo espacio */
    width: 0; /* Necesario para que flex-basis funcione correctamente */
}

/* --- ESTILOS PARA GESTIÓN DE SOLICITUDES --- */
.solicitudes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}
.solicitud-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.solicitud-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}
.solicitud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}
.solicitud-id {
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}
.solicitud-fecha { font-size: 0.9em; color: #6c757d; }
.solicitud-body { padding: 20px; flex-grow: 1; }
.solicitud-body p { margin: 0 0 10px 0; }
.solicitud-body p:last-child { margin-bottom: 0; }
.solicitud-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background-color: #f8f9fa;
}
.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--success-color);
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.2s;
}
.whatsapp-link:hover {
    background-color: rgba(25, 135, 84, 0.1);
}
.analisis-resultado h4 {
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.analisis-ok h4 { color: var(--success-color); }
.analisis-warn h4 { color: #fd7e14; }

.cuenta-existente-item {
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid transparent;
}
.fondo-verde { background-color: rgba(25, 135, 84, 0.1); border-color: rgba(25, 135, 84, 0.2); }
.fondo-celeste { background-color: rgba(13, 202, 240, 0.1); border-color: rgba(13, 202, 240, 0.2); }
.fondo-rojo { background-color: rgba(220, 53, 69, 0.1); border-color: rgba(220, 53, 69, 0.2); }
.cuenta-acciones { margin-top: 15px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-accion {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid;
    cursor: pointer;
    background-color: white;
}

/* Ajuste para achicar todo el box de login */
#consulta-section {
    max-width: 450px; /* Ancho máximo para el contenedor del formulario */
    margin-left: auto;
    margin-right: auto;
}

#saldo-cuenta-container .btn {
    width: auto; /* Ancho automático */
    padding: 8px 15px; /* Padding más pequeño */
    font-size: 14px; /* Fuente más pequeña */
}
.btn-aplicar-solicitud {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.input-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.input-row .input-group {
    margin-bottom: 20px; /* Mantener el margen inferior consistente */
}

.btn-mercadopago {
    background-color: var(--mercadopago-color);
    color: white;
    border-color: var(--mercadopago-color);
}

.btn-qr {
    background-color: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.form-row-login {
    display: flex;
    gap: 15px;
    align-items: flex-end; /* Alinea los elementos por su base */
}

.form-row-login .input-group {
    margin-bottom: 20px;
}

.form-row-login .input-group-grow {
    flex-grow: 1; /* Hace que este grupo ocupe el espacio restante */
}

.form-row-login #tipo-doc {
    width: auto; /* Permite que el select se ajuste a su contenido */
    min-width: 90px; /* Un ancho mínimo para que no se vea mal */
}

.form-row {
    display: flex;
    gap: 20px; /* Espacio entre los elementos */
    align-items: flex-start; /* Alinear items al inicio */
}

.form-row .input-group {
    flex: 1; /* Permitir que los elementos crezcan y ocupen el espacio */
}

/* --- ESTILOS RESPONSIVOS --- */
@media (max-width: 768px) {
    body {
        padding: 10px; /* Reducir padding general en móviles */
        align-items: flex-start; /* Alinear contenido al inicio en móviles */
        padding-top: 20px;
    }

    .container {
        padding: 0 10px;
    }

    header {
        flex-direction: column;
        text-align: center;
        gap: 10px; /* Reducir el espacio en el header */
    }

    header h1 {
        font-size: 1.5em; /* Reducir tamaño del título principal */
        text-align: center;
    }

    .card {
        padding: 20px; /* Reducir padding de las tarjetas */
    }

    .form-row-login {
        flex-direction: column;
        gap: 0;
    }

    .form-row-login .input-group {
        margin-bottom: 20px; /* Mantener el espaciado entre grupos */
    }

    .input-row, .form-row {
        flex-direction: column;
        gap: 0; /* Eliminar el gap para que los input-group se peguen */
    }
    .apartado-documentacion .form-row {
        flex-direction: column;
        gap: 20px; /* Re-aplicar gap para la sección de documentos en móvil */
    }

    /* Asegurar que los selectores con ancho fijo ocupen todo el espacio */
    #form-paso2 select[style*="width"] {
        width: 100% !important;
    }

    /* Ajustar la sección del router para móviles */
    #seccion-router-grid {
        flex-direction: column;
    }
    #vista-previa-router {
        margin-left: 0;
        margin-top: 20px; /* Añadir espacio superior */
        align-self: center; /* Centrar la vista previa */
    }
    #imagen-plan {
        height: auto !important;
        max-width: 150px; /* Limitar el ancho en móviles */
        margin-left: auto;
        margin-right: auto;
    }
    .phone-input-group {
        flex-direction: column;
    }
    .phone-input-group select {
        flex-basis: auto;
    }

    /* --- NUEVOS AJUSTES PARA LA PÁGINA DE SALDO --- */
    .dashboard-container {
        flex-direction: column;
        gap: 20px;
    }

    .dashboard-column {
        min-width: 100%;
    }

    .apartado-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .resumen-total {
        font-size: 2.2em;
    }

    #mapa-container-fullwidth {
        height: 200px;
    }

    .factura-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 15px;
    }

    .factura-item > * {
        flex-basis: auto !important;
        width: 100%;
        text-align: left !important;
        margin-left: 0 !important;
    }

    .factura-info {
        order: 1;
    }

    .factura-monto {
        order: 2;
        font-size: 1.2em;
        text-align: right !important;
    }
    
    /* Específico para el historial unificado */
    .factura-header {
        display: flex;
        font-weight: bold;
        padding-bottom: 10px;
        border-bottom: 2px solid #333;
    }
    
    .factura-header span {
        flex: 1;
        text-align: left;
    }

    .factura-header .accion-cell {
        text-align: center;
    }

    @media (max-width: 768px) {
        .factura-header {
            display: none; /* Ocultar cabecera en móviles */
        }

        #lista-facturas-unificada .factura-item {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }

        #lista-facturas-unificada .factura-item span[data-label] {
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            text-align: right !important;
            font-size: 0.9em; /* Reducir tamaño de fuente */
        }
    
        .accion-impaga {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 15px; /* Espacio entre checkbox y PDF */
        }

        #lista-facturas-unificada .factura-item span[data-label]::before {
            content: attr(data-label);
            font-weight: bold;
            text-align: left;
            margin-right: 10px;
        }
        
        #lista-facturas-unificada .factura-item span[data-label="Acción"] {
            justify-content: flex-end;
        }
    }


    .button-group.payment-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .button-group.payment-buttons .btn {
        width: 100%;
    }

    .total-a-pagar {
        justify-content: center;
        font-size: 1.2em;
        padding: 10px 0;
    }
}



.btn-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-pdf svg {
    width: 22px;
    height: 22px;
    fill: #dc3545; /* Rojo */
    transition: fill 0.2s;
}
.btn-pdf:hover {
    background-color: rgba(220, 53, 69, 0.1); /* Fondo rojo claro al pasar el mouse */
}

.estado-factura {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.estado-pagada {
    background-color: #28a745; /* Verde éxito */
}
.estado-impaga {
    background-color: #dc3545; /* Rojo peligro */
}

/* --- ESTILOS PARA LOS NUEVOS DASHBOARDS --- */
.stat-number {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--primary-color);
    margin: 10px 0 0 0;
}

.dashboard-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.dashboard-card h3 {
    margin: 0;
    font-size: 1.1em;
    color: #6c757d;
    font-weight: 500;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 400px; /* Altura por defecto para el gráfico */
}

.four-columns {
    grid-template-columns: repeat(4, 1fr);
}

.five-columns {
    grid-template-columns: repeat(5, 1fr);
}

/* Colores para las tarjetas del dashboard operativo */
.card-activos { background-color: rgba(25, 135, 84, 0.1); }
.card-aviso-suspension { background-color: rgba(255, 159, 64, 0.1); }
.card-falta-pago { background-color: rgba(255, 193, 7, 0.1); }
.card-bloqueados { background-color: rgba(108, 117, 125, 0.1); }
.card-baja { background-color: rgba(220, 53, 69, 0.1); }

.card-activos .stat-number { color: #198754; }
.card-aviso-suspension .stat-number { color: #ff9f40; }
.card-falta-pago .stat-number { color: #ffc107; }
.card-bloqueados .stat-number { color: #6c757d; }
.card-baja .stat-number { color: #dc3545; }

/* --- NUEVOS ESTILOS PARA TARJETAS FINANCIERAS --- */
.card-facturado { background-color: rgba(54, 162, 235, 0.1); }
.card-cobrado { background-color: rgba(25, 135, 84, 0.1); }
.card-deuda-activos { background-color: rgba(255, 159, 64, 0.1); }
.card-deuda-inactivos { background-color: rgba(220, 53, 69, 0.1); }

.card-facturado .stat-number { color: #36a2eb; }
.card-cobrado .stat-number { color: #198754; }
.card-deuda-activos .stat-number { color: #ff9f40; }
.card-deuda-inactivos .stat-number { color: #dc3545; }

.card-footer-indices {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 10px 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
    gap: 10px;
}
.indice-item {
    text-align: center;
}
.indice-item span {
    font-size: 0.8em;
    color: #6c757d;
    display: block;
}
.indice-item strong {
    font-size: 1.1em;
    font-weight: 700;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablets */
    }
    .kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 576px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* 1 columna en móviles */
    }
    .stat-number {
        font-size: 2em;
    }
    .chart-container {
        height: 300px; /* Menos altura en móviles */
    }
}

/* --- ESTILOS PARA FILTROS DE DASHBOARD --- */
.form-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.form-filters .input-group {
    flex: 1 1 150px; /* Crece y se encoge, con una base de 150px */
    margin-bottom: 0;
}

.form-filters .btn {
    flex: 0 1 auto; /* No crece, se encoge si es necesario */
    width: auto;
    padding: 12px 25px;
}

/* --- ESTILOS PARA GESTIÓN DE USUARIOS --- */
.permisos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.permiso-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
.permiso-item input[type="checkbox"] {
    width: auto;
}
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.user-table th, .user-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
    font-size: 0.85em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px; /* Evita que una columna se haga excesivamente ancha */
}

.user-table td:last-child {
    max-width: none; /* Permite que la columna de acciones tenga el ancho que necesite */
    width: 1%; /* Truco para que ocupe el mínimo espacio posible */
}
.user-table th {
    background-color: #f8f9fa;
}
.user-table .celda-cliente {
    white-space: nowrap;
}
.btn-edit, .btn-delete {
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-weight: 500;
}
.btn-edit {
    background-color: var(--primary-color);
    margin-right: 5px;
}
.btn-delete {
    background-color: var(--error-color);
}
.btn-resend {
    background-color: #ffc107; /* Amarillo */
    margin-right: 5px;
}
.btn-resend {
    background-color: #ffc107; /* Amarillo */
    margin-right: 5px;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: #212529; /* Texto oscuro para mejor contraste */
    font-weight: 500;
}

/* --- NUEVOS ESTILOS PARA FORMULARIO DE USUARIOS --- */
.user-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}
.form-column {
    flex: 1;
    min-width: 300px;
}
.form-full-width {
    flex-basis: 100%;
    display: flex;
    gap: 15px;
}
.table-responsive {
    overflow-x: auto;
}
@media (max-width: 768px) {
    .user-form-grid {
        flex-direction: column;
    }
}

/* --- NUEVOS ESTILOS PARA HEADER --- */
.header-user-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
.welcome-user {
    margin: 0;
    font-weight: 500;
    color: #6c757d;
}
.header-buttons {
    display: flex;
    gap: 10px;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.9em;
    font-weight: 500;
    width: auto;
}

/* --- ESTILOS PARA MESA DE AYUDA --- */
#info-cliente-div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

/* --- ESTILOS PARA MÓDULO DE COMUNICACIONES --- */
#form-nueva-comunicacion #destinatarios,
#form-nueva-comunicacion #asunto {
    max-width: 30ch; /* Limita el ancho a aprox. 30 caracteres */
    width: 100%; /* Asegura que sea responsivo */
}

#form-nueva-comunicacion #mensaje {
    min-height: 150px; /* Aumenta la altura mínima */
    resize: vertical; /* Permite al usuario redimensionar verticalmente */
}

#modal-ayuda .modal-content {
    max-width: 500px;
}

#form-mesa-ayuda textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    resize: vertical;
    min-height: 100px;
}

/* --- ESTILOS PARA MODAL DE CONVERSACIÓN --- */
#modal-conversacion .modal-content {
    max-width: 600px;
}

.chat-body {
    height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #E5DDD5; /* Fondo similar a WhatsApp */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 12px;
    font-size: 1em;
    line-height: 1.4;
    position: relative;
}

.chat-bubble .autor-nombre {
    font-weight: 700;
    font-size: 0.9em;
    margin: 0 0 5px 0;
    color: #0056b3;
}

.bubble-enviado .autor-nombre {
    color: #155724;
}

.chat-bubble .texto {
    margin: 0;
    white-space: pre-wrap; /* Para respetar saltos de línea en el mensaje */
    word-wrap: break-word; /* Para forzar el ajuste de palabras largas */
    word-break: break-word; /* Asegura el corte de palabras para evitar desbordamiento */
}

.chat-bubble .fecha {
    display: block;
    font-size: 0.75em;
    color: #888;
    margin-top: 5px;
    text-align: right;
}

.bubble-recibido {
    background-color: #FFFFFF; /* Burbuja blanca para mensajes recibidos */
    align-self: flex-start;
    border-top-left-radius: 0;
}

.bubble-enviado {
    background-color: #DCF8C6; /* Burbuja verde claro para mensajes enviados */
    align-self: flex-end;
    border-top-right-radius: 0;
}

#form-respuesta-suceso textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    resize: vertical;
}

/* --- ESTILOS PARA HEADER DE HISTORIAL --- */
.historial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* Espacio antes de la tabla */
    flex-wrap: wrap;
    gap: 15px;
}

.historial-header h2 {
    margin: 0;
}

.filtro-historial {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filtro-historial label {
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
}


/* Reducir tamaño de fuente del título del chat */
#conversacion-titulo {
    font-size: 1.2em; /* Ajusta este valor según sea necesario */
}


/* Estilo para el badge de notificación en la tabla de comunicaciones */
.notification-badge {
    background-color: var(--error-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 5px;
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
}


/* Estilo para el estado finalizado en la tabla de comunicaciones */
.estado-finalizado {
    background-color: #6c757d; /* Gris secundario */
}


/* Estilo para notificaciones finalizadas en el panel del cliente */
.notification-item.finalizado {
    background-color: #f8f9fa; /* Un gris muy claro */
    opacity: 0.7;
}

/* --- ESTILOS RESPONSIVOS ADICIONALES PARA NOTIFICACIONES Y CHAT --- */
@media (max-width: 768px) {
    /* Ajustes para el panel de notificaciones */
    .notification-panel {
        /* Convertir de dropdown a modal centrado en móviles */
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 500px;
        height: auto; /* Altura basada en contenido */
        max-height: 80vh; /* Con un máximo de altura */
        right: auto; /* Anular posicionamiento de dropdown */
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
        border-radius: 12px;
        display: flex;
        flex-direction: column;
    }

    /* Ajustes para el modal de conversación/chat */
    #modal-conversacion .modal-content {
        width: 95%;
        margin: 15% auto; /* Margen superior mayor para mejor centrado vertical */
        padding: 15px;
    }

    .chat-body {
        height: 60vh; /* Más altura para el cuerpo del chat */
    }

    #conversacion-titulo {
        font-size: 1.1em; /* Título un poco más pequeño */
    }
}

/* --- ESTILOS PARA EL NUEVO DASHBOARD DE GESTIÓN --- */
body.gestion-body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--light-gray);
    color: var(--dark-gray);
    margin: 0;
    padding: 20px;
}

.gestion-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.gestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.gestion-logo {
    max-width: 150px;
}

.gestion-user-controls {
    text-align: right;
}

.gestion-welcome-user {
    margin: 0 0 5px 0;
    font-weight: 500;
}

.gestion-btn-logout {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9em;
}

.gestion-nav-menu {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 10px;
    margin-bottom: 20px;
}

.gestion-nav-tabs {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid var(--primary-color);
}

.gestion-nav-tab {
    margin-bottom: -2px;
}

.gestion-nav-link {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    transition: all 0.3s ease;
}

.gestion-nav-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.gestion-nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.gestion-tab-content {
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: var(--shadow);
    padding: 30px;
}

.gestion-tab-pane {
    display: none;
}

.gestion-tab-pane.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gestion-iframe-container {
    width: 100%;
    height: 70vh;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

@media (max-width: 768px) {
    .gestion-nav-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    .gestion-nav-tab {
        margin-bottom: 5px;
    }
    .gestion-nav-link {
        border-radius: 6px;
        border: 2px solid transparent;
    }
    .gestion-nav-link.active {
        border-color: var(--primary-color);
    }
    .gestion-header {
        flex-direction: column;
        text-align: center;
    }
    .gestion-user-controls {
        text-align: center;
        margin-top: 10px;
    }
}

/* --- ESTILOS PARA MENÚ DESPLEGABLE --- */
.gestion-nav-tab.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.dropdown.open > .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--dark-gray);
    font-weight: 500;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: var(--light-gray);
}

/* --- ESTILOS PARA SUBMENÚ LATERAL --- */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    display: none;
}

.dropdown-submenu.open > .dropdown-menu {
    display: block;
}

/* Estilo para botones de advertencia (naranja) */
.btn-warning, .btn-warning:hover, .btn-warning:active, .btn-warning:focus {
    background-color: #ffc107 !important;
    color: #212529 !important;
    border-color: #ffc107 !important;
}

/* --- NUEVOS ESTILOS PARA SOLICITUD DE SERVICIO (PASO 2) --- */
.router-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    background-color: #fdfdff;
}

.router-preview {
    margin-top: 20px;
    padding: 20px;
    border: 1px dashed var(--primary-color);
    border-radius: 8px;
    text-align: center;
    background-color: #f8f9fa;
}

.router-preview img {
    max-width: 100%;
    max-height: 180px;
    height: 180px; /* Altura fija para el contenedor */
    object-fit: contain; /* Asegura que la imagen quepa sin deformarse */
    margin-bottom: 15px;
    border-radius: 8px;
}

.router-preview span {
    display: block;
    font-weight: 700;
    font-size: 1.4em;
    color: var(--primary-color);
}

.apartado-documentacion {
    border: 1px solid var(--success-color);
    border-radius: 8px;
    margin-top: 30px;
    background-color: #f6fff9;
}

.apartado-documentacion .apartado-header {
    background-color: rgba(25, 135, 84, 0.1);
    border-bottom: 1px solid rgba(25, 135, 84, 0.2);
}

.apartado-documentacion .apartado-header h3 {
    color: var(--success-color);
    font-size: 1.3em;
}

.apartado-documentacion .apartado-body {
    padding: 25px;
}

.required-star {
    color: var(--error-color);
    font-weight: bold;
}

/* Estilos para la sección de historial de facturas */
.historial-toggle {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.historial-toggle a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.historial-toggle a:hover {
    color: var(--dark-primary-color);
    text-decoration: underline;
}

#historial-facturas-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed #ddd;
}

#historial-facturas-container .apartado-header h3 {
    color: #555; /* Un color más suave para el título del historial */
}

/* Ajustes menores para asegurar consistencia */
#lista-facturas-impagas .factura-item:last-child,
#lista-facturas-pagadas .factura-item:last-child {
    border-bottom: none;
}


/* --- ESTILOS PARA OPCIONES DE ENVÍO EN MAILING_INICIO.PHP --- */
.opciones-envio-grid {
    display: flex;
    gap: 25px;
    margin-top: 25px;
}

.opcion-envio-card {
    flex: 1;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid transparent;
}

.opcion-envio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.opcion-envio-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.4em;
}

.opcion-envio-card p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Colores específicos para cada tarjeta */
#btn-iniciar-proceso {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

#btn-iniciar-individual {
    background-color: #ffc107; /* Amarillo (Warning) */
    color: #212529; /* Texto oscuro para contraste */
    border-color: #ffc107;
}

#btn-iniciar-individual h3 {
    color: #5d4a00;
}


/* --- AJUSTE PARA ANCHO DE SELECTS EN MODALES --- */
.modal-content .input-group select {
    width: auto;
    min-width: 200px; /* Asegura un ancho mínimo legible */
}
