/* public/css/style.css (Versión 2.0 Regenerada) */
:root {
    --primary-color: #005A9C;
    --secondary-color: #F58220;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --background-color: #f4f7f6;
    --surface-color: #ffffff;
    --white: #ffffff;
    --text-color: #333333;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-900: #111827;
    --header-footer-bg: #1e293b;
    --header-footer-text: #ffffff;
    --border-color: #e2e8f0;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-sm: 0.875rem;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
    --border-radius: 8px;
    --border-radius-md: 6px;
    --border-radius-lg: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition-base: all 0.2s ease-in-out;
}

/* Estilos principales para la aplicación multimarcas */

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Filtros */
.filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filters .form-control {
    width: auto;
}

/* Estados vacíos */
.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-state p:first-child {
    font-size: 1.2em;
    margin-bottom: 0.5rem;
}

/* Estadísticas */
.stat-item {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.container {
    width: 95%;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.main-header {
    background-color: var(--header-footer-bg);
    color: var(--header-footer-text);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.main-header .logo { font-size: 1.5rem; font-weight: bold; }
.main-nav ul { list-style: none; display: flex; gap: 1.5rem; }
.main-nav a {
    color: var(--header-footer-text);
    text-decoration: none;
    font-size: 1rem;
    padding: 0.5rem 0.2rem;
    position: relative;
    transition: color 0.3s;
}
.main-nav a:hover, .main-nav a.active { color: var(--secondary-color); }
.main-footer {
    background-color: var(--header-footer-bg);
    color: var(--header-footer-text);
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
}
h1, h2 { color: var(--primary-color); margin-bottom: 1.5rem; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}
.data-table th, .data-table td { border: 1px solid var(--border-color); padding: 0.7rem; text-align: left; vertical-align: middle; }
.data-table th { background-color: var(--primary-color); color: white; font-weight: 600; }
.data-table tr:nth-child(even) { background-color: #f8f9fa; }
.data-table tr:hover { background-color: #e9ecef; }

.action-buttons { 
    display: flex; 
    gap: 0.75rem; 
    flex-wrap: wrap; 
    justify-content: center;
}

.btn-action {
    padding: 0.6rem 0.8rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    font-size: 1.1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 40px;
    min-height: 40px;
    position: relative;
    overflow: hidden;
}

.btn-action:hover { 
    transform: translateY(-2px) scale(1.05); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-action:active {
    transform: translateY(0) scale(0.98);
}

.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-action:hover::before {
    left: 100%;
}

/* Estilos específicos para cada tipo de botón */
.btn-view { 
    background: linear-gradient(135deg, #007bff, #0056b3); 
    border: 2px solid transparent;
}

.btn-view:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    border-color: #007bff;
}

.btn-edit { 
    background: linear-gradient(135deg, #28a745, #1e7e34); 
}

.btn-edit:hover {
    background: linear-gradient(135deg, #1e7e34, #155724);
}

.btn-delete { 
    background: linear-gradient(135deg, #dc3545, #c82333); 
}

.btn-delete:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
}

.btn-print { 
    background: linear-gradient(135deg, #6366f1, #4f46e5); 
}

.btn-print:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
}

.btn-whatsapp { 
    background: linear-gradient(135deg, #25d366, #128c7e); 
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128c7e, #075e54);
}

.btn-email { 
    background: linear-gradient(135deg, #f97316, #ea580c); 
}

.btn-email:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

/* Estilos para el texto de los botones */
.btn-text {
    margin-left: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Responsive para botones de acción */
@media (max-width: 768px) {
    .btn-text {
        display: none;
    }
    
    .btn-action {
        min-width: 35px;
        min-height: 35px;
        padding: 0.5rem;
        font-size: 1rem;
    }
    
    .action-buttons {
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .btn-action {
        min-width: 32px;
        min-height: 32px;
        padding: 0.4rem;
        font-size: 0.9rem;
    }
}

/* Estilos para botones deshabilitados */
.btn-disabled {
    background: linear-gradient(135deg, #9ca3af, #6b7280) !important;
    color: #d1d5db !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    box-shadow: none !important;
}

.btn-disabled:hover {
    background: linear-gradient(135deg, #9ca3af, #6b7280) !important;
    transform: none !important;
    box-shadow: none !important;
}

.form-container { max-width: 800px; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: var(--primary-color); }
.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
}
.btn-submit {
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}
.btn-submit:hover { background-color: var(--secondary-color); }

.simulator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 768px) {
    .simulator-grid { grid-template-columns: 1fr 1fr; }
}
.results-display {
    background-color: #eef7ff;
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 5px solid var(--primary-color);
}
.results-display h3 { color: var(--primary-color); margin-bottom: 1rem; }
.results-display p { font-size: 1.1rem; margin-bottom: 0.75rem; display: flex; justify-content: space-between; flex-wrap: wrap; }
.results-display p span:first-child { font-weight: 600; }
.results-display .total { font-size: 1.5rem; font-weight: bold; color: var(--secondary-color); margin-top: 1rem; }

/* Estilos para impresión */
@media print {
    body * { visibility: hidden; }
    .printable-area, .printable-area * { visibility: visible; }
    .printable-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print { display: none !important; }
}
.report-container { border: 1px solid #ccc; padding: 2rem; }
.report-header { text-align: center; margin-bottom: 2rem; }
.report-header img { max-width: 150px; max-height: 100px; object-fit: contain; margin-bottom: 1rem; }
.report-details { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0; text-align: left; }
.report-items table { width: 100%; }
.report-footer { text-align: center; margin-top: 3rem; font-size: 0.8rem; color: #666; }

/* ===== ESTILOS PARA EL PANEL DE CONTROL ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0 0 5px 0;
}

.stat-content p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.brands-chart {
    max-width: 600px;
}

.brand-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.brand-info {
    min-width: 150px;
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: bold;
    color: var(--primary-color);
}

.brand-count {
    font-size: 12px;
    color: #666;
}

.brand-bar {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.quick-actions {
    margin-top: 40px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.action-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
    text-decoration: none;
    color: inherit;
}

.action-card i {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.action-card h3 {
    color: var(--primary-color);
    margin: 10px 0;
    font-size: 18px;
}

.action-card p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* ===== ESTILOS PARA EL SIMULADOR ===== */
.simulator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.simulator-form, .simulator-results {
    min-height: 400px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--primary-color);
}

.form-group label i {
    margin-right: 8px;
    width: 16px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.form-group input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.results-hidden {
    display: none !important;
}

.result-summary {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #dee2e6;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item.highlight {
    background: rgba(44, 90, 160, 0.1);
    margin: 0 -15px;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 18px;
}

.summary-item .label {
    color: #495057;
    font-weight: 500;
}

.summary-item .value {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 16px;
}

.amortization-section {
    margin-top: 30px;
}

.amortization-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.result-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.info-section {
    margin-top: 40px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.info-item i {
    color: var(--primary-color);
    font-size: 24px;
    margin-top: 5px;
}

.info-item h4 {
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-size: 16px;
}

.info-item p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== ESTILOS PARA CRÉDITOS ===== */
.credits-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.summary-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.summary-content h3 {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0 0 5px 0;
}

.summary-content p {
    color: #666;
    margin: 0;
    font-size: 12px;
}

.customer-info strong {
    color: var(--primary-color);
}

.reference-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.amount {
    font-weight: bold;
    color: #28a745;
}

.amount.highlight {
    color: var(--primary-color);
    font-size: 16px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-activo {
    background: #d4edda;
    color: #155724;
}

.status-pagado {
    background: #d1ecf1;
    color: #0c5460;
}

.status-vencido {
    background: #f8d7da;
    color: #721c24;
}

.status-cancelado {
    background: #f1f3f4;
    color: #495057;
}

/* ===== ESTILOS PARA CONFIGURACIÓN ===== */
.config-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.config-form {
    min-height: 600px;
}

.config-preview {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.preview-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 2px dashed #dee2e6;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.preview-logo img {
    max-width: 80px;
    max-height: 60px;
    border-radius: 8px;
}

.logo-placeholder {
    width: 80px;
    height: 60px;
    background: #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 24px;
}

.preview-info h3 {
    color: var(--primary-color);
    margin: 0 0 5px 0;
    font-size: 18px;
}

.preview-info p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.preview-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #495057;
}

.contact-item i {
    color: var(--primary-color);
    width: 16px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-list .info-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-list .info-item i {
    color: var(--primary-color);
    font-size: 20px;
    margin-right: 15px;
}

.info-list .info-item h4 {
    color: var(--primary-color);
    margin: 0 0 5px 0;
    font-size: 14px;
}

.info-list .info-item p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* ===== ESTILOS PARA MODALES PERSONALIZADOS (NO BOOTSTRAP) ===== */
.modal:not(.fade) {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

/* Evitar conflictos con modales de Bootstrap 5 */
.modal.fade {
    display: none !important;
}

.modal.fade.show {
    display: block !important;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.modal-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 25px;
}

.credit-details h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== RESPONSIVE DESIGN PARA NUEVAS PÁGINAS ===== */
@media (max-width: 768px) {
    .simulator-container,
    .config-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid,
    .actions-grid,
    .credits-summary {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .config-preview {
        position: static;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .form-actions,
    .result-actions {
        flex-direction: column;
    }
    
    .preview-header {
        flex-direction: column;
        text-align: center;
    }
    
    .customer-modal .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

/* ===== ESTILOS PARA MODAL DE CLIENTES ===== */
.customer-modal .modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* ===== CORRECCIÓN PARA BOOTSTRAP 5 MODALS ===== */
#editCustomerModal.modal {
    display: none !important;
    z-index: 1055 !important;
}

#editCustomerModal.modal.show {
    display: block !important;
    z-index: 1055 !important;
}

#editCustomerModal .modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

#editCustomerModal .modal-dialog {
    z-index: 1056 !important;
    position: relative !important;
}

#editCustomerModal .modal-content {
    background-color: white !important;
    border: none !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    z-index: 1057 !important;
    position: relative !important;
}

#editCustomerModal .modal-header {
    background: var(--primary-color) !important;
    color: white !important;
    border-bottom: 1px solid #dee2e6 !important;
    z-index: 1058 !important;
    position: relative !important;
}

#editCustomerModal .modal-body {
    background-color: white !important;
    color: var(--text-color) !important;
    z-index: 1058 !important;
    position: relative !important;
}

#editCustomerModal .modal-footer {
    background-color: white !important;
    border-top: 1px solid #dee2e6 !important;
    z-index: 1058 !important;
    position: relative !important;
}

/* Asegurar que todos los elementos del modal sean clickeables */
#editCustomerModal * {
    pointer-events: auto !important;
}

#editCustomerModal .modal-dialog {
    pointer-events: none !important;
}

#editCustomerModal .modal-content {
    pointer-events: auto !important;
}

/* ===== CORRECCIÓN PARA MODAL AGREGAR PAGO ===== */
#modalAgregarPago.modal {
    z-index: 1055 !important;
}

#modalAgregarPago .modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
}

#modalAgregarPago .modal-dialog {
    z-index: 1056 !important;
    position: relative !important;
}

#modalAgregarPago .modal-content {
    background-color: white !important;
    border: none !important;
    border-radius: 0.375rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    z-index: 1057 !important;
    position: relative !important;
}

#modalAgregarPago * {
    pointer-events: auto !important;
}

#modalAgregarPago .modal-dialog {
    pointer-events: none !important;
}

#modalAgregarPago .modal-content {
    pointer-events: auto !important;
}

.customer-search-section,
.customer-register-section {
    margin-bottom: 25px;
}

.customer-search-section h4,
.customer-register-section h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: end;
}

.search-form .form-group {
    flex: 1;
    margin-bottom: 0;
}

.search-form button {
    height: 38px;
    white-space: nowrap;
    min-width: 100px;
}

.divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #dee2e6;
}

.divider span {
    background-color: white;
    padding: 0 15px;
    color: #6c757d;
    font-weight: 500;
}

.customer-register-section .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.customer-register-section .form-row .form-group {
    flex: 1;
}

.search-results {
    margin-top: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    background: white;
}

.customer-list {
    padding: 0;
    margin: 0;
}

.customer-item {
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-item:hover {
    background-color: #f8f9fa;
}

.customer-item:last-child {
    border-bottom: none;
}

.customer-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.customer-main-info {
    flex: 1;
}

.customer-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 16px;
}

.customer-details {
    font-size: 14px;
    color: #666;
    display: flex;
    gap: 15px;
}

.customer-select-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.customer-select-btn:hover {
    background: var(--secondary-color);
}

.selected-customer {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.selected-customer h5 {
    margin: 0 0 10px 0;
    color: #155724;
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-info span {
    font-weight: 600;
    color: #155724;
    font-size: 16px;
}

.customer-info small {
    display: block;
    color: #6c757d;
    margin-top: 4px;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
    padding: 15px 20px;
}

.modal-actions .btn {
    padding: 12px 24px;
    min-width: 120px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.no-results {
    padding: 30px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.no-results i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 15px;
    display: block;
}

/* Loading state */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.form-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

.form-group.error input {
    border-color: #dc3545;
}

.success-message {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
