/* Botón eliminar certificado */
.btn-delete {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    margin-left: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s;
}
.btn-delete:hover {
    background: #a71d2a;
}
/* Estilos generales */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

    /* --- Formularios colapsables (Facturación) --- */
    .formulario-header-collapsible {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
    }

    .toggle-form-btn {
        border: 1px solid #007bff;
        background: #f5f9ff;
        color: #007bff;
        padding: 8px 16px;
        border-radius: 6px;
        cursor: pointer;
        font-weight: 600;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .toggle-form-btn:hover {
        background: #007bff;
        color: #fff;
    }

    .collapsible-panel {
        margin-top: 15px;
        border-top: 1px solid #e0e0e0;
        padding-top: 20px;
    }

    .collapsible-panel.collapsed {
        display: none;
    }

    .collapsible-panel.expanded {
        display: block;
    }

header {
    background: #e62020;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Estilos para el logo y branding */
.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-brand .logo {
    height: 50px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    background: rgba(255,255,255,0.1);
    padding: 5px;
    border-radius: 8px;
}

.header-brand h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

/* Si la imagen no carga, mostrar texto alternativo */
.header-brand .logo[alt]:after {
    content: attr(alt);
    display: block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 768px) {
    .header-brand {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .header-brand .logo {
        height: 40px;
        max-width: 100px;
    }
    
    .header-brand h1 {
        font-size: 1.2rem;
    }
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.usuario-info {
    font-size: 0.9rem;
    color: #f8d7da;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

header h1 {
    margin: 0;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline;
    margin: 0 10px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
}

main {
    padding: 2rem;
}

footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    margin-top: 3rem;
    width: 100%;
}

/* Estilos para accesos rápidos */
.accesos-rapidos {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.accesos-rapidos h3 {
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.botones-rapidos {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.boton-rapido {
    display: block;
    text-decoration: none;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    width: 250px;
    text-align: center;
    transition: all 0.3s ease;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.boton-rapido:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: #007bff;
}

.boton-factura:hover {
    border-color: #28a745;
    background: #f8fff9;
}

.boton-pago:hover {
    border-color: #ffc107;
    background: #fffef8;
}

/* Estilos para la sección de bienvenida */
.welcome-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    margin: 2rem 0;
}

.dashboard-link-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.dashboard-link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.dashboard-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.boton-rapido .icono {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.boton-rapido h4 {
    color: #333;
    margin: 0.5rem 0;
    font-size: 1.2rem;
}

.boton-rapido p {
    color: #666;
    margin: 0;
    font-size: 0.9rem;
}

/* Estilos para formularios CRUD */
.formulario-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.formulario-container h3 {
    color: #333;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
}

.form-group.full-width {
    flex: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-buttons {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
    font-weight: 500;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-warning:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Estilos para botones deshabilitados */
.btn-secondary:disabled,
.btn-primary:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Estilos para tablas CRUD */
.tabla-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.tabla-container h3 {
    color: #333;
    margin-bottom: 1rem;
    border-bottom: 2px solid #28a745;
    padding-bottom: 0.5rem;
}

.crud-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.crud-table th,
.crud-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.crud-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.crud-table tr:hover {
    background-color: #f5f5f5;
}

.crud-table .btn-edit {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-right: 0.25rem;
}

.crud-table .btn-edit:hover {
    background: #e0a800;
}

.crud-table .btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
}

.crud-table .btn-delete:hover {
    background: #c82333;
}

.crud-table .btn-view {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-right: 0.25rem;
}

.crud-table .btn-view:hover {
    background: #138496;
}

/* ============================================ */
/* MOBILE CARDS - ESTILOS POR DEFECTO */
/* ============================================ */

.mobile-table-cards {
    display: none; /* Oculto por defecto, se muestra en móviles */
}

.mobile-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mobile-card-header {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.mobile-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mobile-card-field {
    display: flex;
    flex-direction: column;
}

.mobile-card-label {
    font-weight: bold;
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.mobile-card-value {
    color: #333;
    font-size: 0.9rem;
}

.mobile-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
}

.mobile-card-actions .btn-edit,
.mobile-card-actions .btn-delete,
.mobile-card-actions .btn-view {
    flex: 1;
    min-width: 40px;
    padding: 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    text-align: center;
    border: none;
    cursor: pointer;
    color: white;
}

.mobile-card-actions .btn-edit {
    background-color: #6c757d;
}

.mobile-card-actions .btn-edit:hover {
    background-color: #5a6268;
}

.mobile-card-actions .btn-delete {
    background-color: #dc3545;
}

.mobile-card-actions .btn-delete:hover {
    background-color: #c82333;
}

.mobile-card-actions .btn-view {
    background-color: #17a2b8;
}

.mobile-card-actions .btn-view:hover {
    background-color: #138496;
}

@media (max-width: 1024px) {
    .crud-table {
        display: none !important;
    }

    .mobile-table-cards {
        display: block !important;
    }
}

/* Estados de factura */
.estado-pendiente {
    color: #ffc107;
    font-weight: bold;
}

.estado-pagado {
    color: #28a745;
    font-weight: bold;
}

.estado-vencido {
    color: #dc3545;
    font-weight: bold;
}

/* Estados de propietarios */
.estado-activo {
    color: #28a745;
    font-weight: bold;
}

.estado-moroso {
    color: #dc3545;
    font-weight: bold;
}

.estado-inactivo {
    color: #6c757d;
    font-weight: bold;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    nav ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 5px 0;
    }

    main {
        padding: 1rem;
    }
    
    .botones-rapidos {
        flex-direction: column;
        align-items: center;
    }
    
    .boton-rapido {
        width: 90%;
        max-width: 300px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .formulario-container {
        padding: 1rem;
    }
    
    .crud-table {
        font-size: 0.875rem;
    }
    
    .crud-table th,
    .crud-table td {
        padding: 0.5rem;
    }
}

/* Estilos para el formulario de generación de PDF */
.concepto-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.concepto-desc {
    flex: 2;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.concepto-valor {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-remove-concepto {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-remove-concepto:hover {
    background: #c82333;
}

#btn-add-concepto {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

#btn-add-concepto:hover {
    background: #218838;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

#btn-generar-pdf {
    background: #007bff;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
}

#btn-generar-pdf:hover {
    background: #0056b3;
}

/* Estilos para botones en la tabla */
.btn-pdf {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

.btn-pdf:hover {
    background: #c82333;
}

.btn-edit {
    background: #ffc107;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-edit:hover {
    background: #e0a800;
}

/* Estilos para la página de login */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 40px 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 3rem;
    margin: 0;
    color: #667eea;
}

.login-header .login-logo {
    height: 80px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    margin-bottom: 15px;
    background: rgba(102, 126, 234, 0.1);
    padding: 10px;
    border-radius: 10px;
}

/* Fallback si la imagen no carga */
.login-header .login-logo[alt]:after {
    content: attr(alt);
    display: block;
    background: #667eea;
    color: #fff;
    padding: 20px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

.login-header h2 {
    color: #333;
    margin: 10px 0 5px 0;
    font-size: 1.8rem;
    font-weight: bold;
}

.login-header h3 {
    color: #667eea;
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: normal;
}

.login-header p {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.login-form {
    text-align: left;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
    font-size: 0.9rem;
}

.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 10px;
}

.login-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-top: 10px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.9rem;
    border-left: 4px solid #c33;
}

/* Success Messages */
.success-message {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.9rem;
    border-left: 4px solid #4caf50;
}

/* Links */
.link-primary {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.link-primary:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Select styles */
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.demo-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.demo-info strong {
    color: #333;
}

/* Responsivo para login */
@media (max-width: 480px) {
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 2.5rem;
    }
    
    .login-header h2 {
        font-size: 1.3rem;
    }
}

/* ==================== ESTILOS PARA NUEVO SISTEMA AJAX ==================== */

/* Toolbar y búsquedas */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    gap: 15px;
}

.search-container {
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Botones mejorados */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-info {
    background: #17a2b8;
}

.btn-info:hover {
    background: #138496;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
}

/* Botones de acción */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Tablas mejoradas */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-container th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table-container td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.table-container tr:hover {
    background: #f8f9fa;
}

.table-container tr:last-child td {
    border-bottom: none;
}

/* Estados vacíos */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Mensajes de error */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 15px 0;
}

/* Validación de formularios */
.error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

.error-message {
    color: #dc3545;
    font-size: 0.8em;
    margin-top: 4px;
}

/* Paginación */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.pagination {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    color: #007bff;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pagination-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 8px 4px;
    color: #6c757d;
}

.pagination-info {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin: 10px 0;
}

/* Modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.modal .modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.modal .close:hover {
    color: #333;
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

/* Estilos para estados de cuenta */
.estado-cuenta-details .propietario-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.estado-cuenta-details .propietario-info p {
    margin: 5px 0;
}

.resumen-financiero {
    margin-bottom: 25px;
}

.resumen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.resumen-item.total {
    border-left-color: #28a745;
    background: #d4edda;
}

.resumen-item .label {
    font-weight: 500;
    color: #495057;
}

.resumen-item .value {
    font-weight: 600;
    color: #333;
}

.movimientos-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.movimientos-table th,
.movimientos-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.movimientos-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.movimientos-table tr:hover {
    background: #f8f9fa;
}

/* Secciones de contenido */
.content-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.content-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

/* Responsividad para nuevos elementos */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }
    
    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .resumen-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 10px;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Modal de Advertencia Crítica */
.modal-advertencia-critica {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.modal-advertencia-content {
    position: relative;
    background: linear-gradient(135deg, #fff 0%, #ffe8e8 100%);
    margin: 3% auto;
    padding: 0;
    border: 4px solid #dc3545;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(220, 53, 69, 0.4);
    animation: slideDown 0.4s;
}

.modal-advertencia-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-advertencia-icono {
    font-size: 40px;
    animation: pulse 1.5s infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.modal-advertencia-titulo {
    flex: 1;
}

.modal-advertencia-titulo h2 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
}

.modal-advertencia-titulo p {
    margin: 3px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.modal-advertencia-body {
    padding: 20px;
}

.modal-advertencia-mensaje {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.modal-advertencia-mensaje p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #856404;
}

.modal-advertencia-lista {
    background: white;
    border: 2px solid #dc3545;
    border-radius: 6px;
    padding: 10px 10px 10px 30px;
    margin: 12px 0;
}

.modal-advertencia-lista ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.modal-advertencia-lista li {
    padding: 5px 0;
    font-size: 13px;
    color: #721c24;
    position: relative;
}

.modal-advertencia-lista li:before {
    content: "❌";
    position: absolute;
    left: -22px;
    font-size: 11px;
}

.modal-advertencia-confirmacion {
    background: #f8d7da;
    border: 2px solid #dc3545;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    text-align: center;
}

.modal-advertencia-confirmacion p {
    margin: 0 0 8px 0;
    font-weight: bold;
    color: #721c24;
    font-size: 14px;
}

.modal-advertencia-confirmacion input {
    width: 100%;
    padding: 8px;
    border: 2px solid #dc3545;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    text-transform: uppercase;
}

.modal-advertencia-botones {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-advertencia-cancelar {
    flex: 1;
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-advertencia-cancelar:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-advertencia-eliminar {
    flex: 1;
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.5;
    pointer-events: none;
}

.btn-advertencia-eliminar.activo {
    opacity: 1;
    pointer-events: auto;
}

.btn-advertencia-eliminar.activo:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================ */
/* RESPONSIVE DESIGN - TABLETS Y MÓVILES */
/* ============================================ */

/* TABLETS Y MÓVILES (hasta 1024px) */
@media screen and (max-width: 1024px) {
    .crud-table {
        display: none !important;
    }
    .mobile-table-cards {
        display: block !important;
    }
}

/* MÓVILES - REGLAS GENERALES (hasta 768px) */
@media screen and (max-width: 768px) {
    .tabla-container {
        overflow-x: hidden;
    }
}

/* TABLETS GRANDES (1024px - 768px) */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    header {
        padding: 1rem 1.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 1.5rem;
    }
    
    .accesos-rapidos {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .botones-rapidos {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-width: 600px;
    }
    
    .boton-rapido {
        padding: 1rem;
        min-height: 80px;
    }
    
    .boton-rapido h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .boton-rapido p {
        font-size: 0.85rem;
    }
    
    .formulario-container,
    .tabla-container {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .crud-table {
        font-size: 0.9rem;
    }
    
    .crud-table th,
    .crud-table td {
        padding: 0.6rem;
    }
    
    .form-row {
        gap: 0.75rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.7rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* TABLETS PEQUEÑAS Y MÓVILES GRANDES (768px - 481px) */
@media screen and (max-width: 768px) and (min-width: 481px) {
    header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .header-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
    
    nav ul li {
        margin: 0;
    }
    
    nav ul li a {
        padding: 0.5rem 1rem;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        display: block;
        font-size: 0.9rem;
        transition: background 0.3s;
    }
    
    nav ul li a:hover {
        background: rgba(255, 255, 255, 0.3);
    }
    
    main {
        padding: 1rem;
    }
    
    .accesos-rapidos h2 {
        font-size: 1.3rem;
        text-align: center;
    }
    
    .botones-rapidos {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .boton-rapido {
        padding: 1.25rem;
        text-align: center;
        min-height: 100px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .boton-rapido h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .boton-rapido p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .formulario-container,
    .tabla-container {
        padding: 1rem;
        border-radius: 6px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
    }
    
    /* Tablas responsivas para tablets */
    .crud-table-wrapper {
        overflow-x: auto;
        margin: -1rem;
        padding: 1rem;
    }
    
    .crud-table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    .crud-table th,
    .crud-table td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }
    
    .crud-table .btn-edit,
    .crud-table .btn-delete,
    .crud-table .btn-view {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
        margin: 0 0.1rem;
    }
}

/* MÓVILES MEDIANOS (480px - 376px) - 6 pulgadas */
@media screen and (max-width: 480px) and (min-width: 376px) {
    body {
        font-size: 14px;
    }
    
    header {
        padding: 0.5rem 0.75rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    header h1 {
        font-size: 1.25rem;
        margin: 0;
    }
    
    .header-info {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.8rem;
    }
    
    .logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    nav ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding: 0;
    }
    
    nav ul li a {
        padding: 0.6rem;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        display: block;
        text-align: center;
        font-size: 0.85rem;
        font-weight: 500;
    }
    
    main {
        padding: 0.75rem;
    }
    
    .accesos-rapidos h2 {
        font-size: 1.2rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .botones-rapidos {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        max-width: 100%;
    }
    
    .boton-rapido {
        padding: 1rem;
        text-align: center;
        min-height: 80px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .boton-rapido h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .boton-rapido p {
        font-size: 0.8rem;
        line-height: 1.3;
        margin: 0;
    }
    
    .formulario-container,
    .tabla-container {
        padding: 0.75rem;
        margin-bottom: 1rem;
        border-radius: 6px;
    }
    
    .formulario-container h2,
    .tabla-container h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .form-buttons {
        margin-top: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.9rem;
        border-radius: 6px;
    }
    
    /* Tablas móviles - Layout de cards */
    .crud-table {
        display: none !important;
    }
    
    .mobile-table-cards {
        display: block !important;
    }
    
    .mobile-card {
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 6px;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .mobile-card-header {
        font-weight: bold;
        color: #007bff;
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }
    
    .mobile-card-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .mobile-card-field {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-card-label {
        font-weight: bold;
        color: #666;
        font-size: 0.75rem;
        margin-bottom: 0.1rem;
    }
    
    .mobile-card-value {
        color: #333;
    }
    
    .mobile-card-actions {
        margin-top: 0.75rem;
        display: flex;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .mobile-card-actions .btn-edit,
    .mobile-card-actions .btn-delete,
    .mobile-card-actions .btn-view {
        flex: 1;
        padding: 0.4rem;
        font-size: 0.8rem;
        border-radius: 4px;
        text-align: center;
    }
    
    /* Conceptos en formularios móviles */
    .concepto-item {
        flex-direction: column;
        gap: 0.5rem;
        background: #f8f9fa;
        padding: 0.75rem;
        border-radius: 6px;
        margin-bottom: 0.75rem;
    }
    
    .concepto-desc,
    .concepto-valor {
        flex: none;
        width: 100%;
    }
    
    .btn-remove-concepto {
        align-self: flex-end;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* MÓVILES PEQUEÑOS (375px y menores) */
@media screen and (max-width: 375px) {
    body {
        font-size: 13px;
    }
    
    header {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.1rem;
    }
    
    nav ul {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    nav ul li a {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    main {
        padding: 0.5rem;
    }
    
    .boton-rapido {
        padding: 0.75rem;
        min-height: 70px;
    }
    
    .boton-rapido h3 {
        font-size: 0.9rem;
    }
    
    .boton-rapido p {
        font-size: 0.75rem;
    }
    
    .formulario-container,
    .tabla-container {
        padding: 0.5rem;
    }
    
    .mobile-card {
        padding: 0.5rem;
    }
    
    .mobile-card-body {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .mobile-card-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .mobile-card-actions .btn-edit,
    .mobile-card-actions .btn-delete,
    .mobile-card-actions .btn-view {
        flex: none;
        width: 100%;
    }
    
    .concepto-item {
        padding: 0.5rem;
    }
    
    /* Tablas móviles - Layout de cards */
    .crud-table {
        display: none !important;
    }
    
    .mobile-table-cards {
        display: block !important;
    }
}

/* Estilo para campo número de recibo editable */
#numero-recibo-pago {
    background-color: #ffffff !important;
    border: 2px solid #2196F3 !important;
    position: relative;
}

#numero-recibo-pago:focus {
    border-color: #0d7377 !important;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3) !important;
}

/* Indicador visual de que es editable */
#numero-recibo-pago::before {
    content: "✏️";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.6;
}

/* =======================================================
   ESTILOS ESPECÍFICOS PARA TABLA DE DEUDAS RESPONSIVE
   ======================================================= */

/* Desktop: Mostrar tabla, ocultar tarjetas */
.deudas-table {
    display: table;
}

.deudas-mobile-cards {
    display: none;
}

/* Estilos específicos para tarjetas de deudas */
.deuda-card {
    border-left: 4px solid #f44336;
    margin-bottom: 1rem;
}

.deuda-card .mobile-card-header {
    background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
    color: white;
    font-weight: bold;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
}

.deuda-card .mobile-card-body {
    background: white;
    padding: 15px;
}

.deuda-card .mobile-card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.deuda-card .mobile-card-field:last-child {
    border-bottom: none;
}

.deuda-card .mobile-card-field label {
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
    min-width: 120px;
}

.deuda-card .mobile-card-total {
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    padding: 15px;
}

/* Media query para móviles - Ocultar tabla, mostrar tarjetas */
@media screen and (max-width: 768px) {
    .deudas-table {
        display: none !important;
    }
    
    .deudas-mobile-cards {
        display: block !important;
        margin-top: 15px;
    }
    
    .deuda-card .mobile-card-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .deuda-card .mobile-card-field label {
        min-width: auto;
        font-size: 0.8em;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .deuda-card .mobile-card-total .btn-small {
        width: 100%;
        margin-top: 10px;
    }
}

/* 📱 PAGINACIÓN POR PERÍODO - Estilos para móvil */
@media screen and (max-width: 768px) {
    /* Botones de paginación más táctiles en móvil */
    .btn-secondary {
        min-height: 44px; /* Tamaño mínimo recomendado para touch */
        font-weight: 600;
        touch-action: manipulation; /* Evita delay en touch */
    }
    
    /* Mejor legibilidad del texto de paginación */
    .btn-secondary:disabled {
        opacity: 0.4 !important;
        transform: none !important;
    }
    
    /* Animación suave para cambios de página */
    #facturas-container {
        transition: opacity 0.3s ease-in-out;
    }
}

/* 🎨 Transición general para contenedor de facturas */
#facturas-container {
    transition: opacity 0.3s ease-in-out;
}

/* 🎨 Transición general para contenedor de pagos */
.tabla-container {
    transition: opacity 0.3s ease-in-out;
}

/* ==================== ESTILOS PARA IMPORTACIÓN/EXPORTACIÓN DE EXCEL ==================== */

/* Sección de botones de importar/exportar */
.import-export-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.import-export-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-download, .btn-import {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download {
    background: #28a745;
    color: white;
}

.btn-download:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.btn-import {
    background: #007bff;
    color: white;
}

.btn-import:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* Modal de importación */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Instrucciones */
.instructions {
    margin-bottom: 20px;
    padding: 15px;
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 6px;
}

.instructions h4 {
    margin: 0 0 10px 0;
    color: #0c5460;
}

.instructions ol {
    margin: 0;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 5px;
    color: #0c5460;
}

/* Zona de carga de archivos */
.file-upload-area {
    margin-top: 20px;
}

.upload-zone {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: #f8f9ff;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: #0056b3;
    background: #f0f6ff;
}

.upload-zone.dragover {
    border-color: #0056b3;
    background: #e6f2ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #007bff;
}

.upload-text p {
    margin: 5px 0;
    color: #333;
}

.upload-text p:first-child {
    font-weight: 600;
    font-size: 16px;
}

.upload-text p:last-child {
    color: #666;
    font-size: 14px;
}

/* Información del archivo seleccionado */
.file-info {
    margin-top: 15px;
    padding: 10px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
}

.file-info strong {
    display: block;
    margin-bottom: 5px;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .import-export-buttons {
        flex-direction: column;
    }
    
    .btn-download, .btn-import {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 15px;
    }
    
    .upload-zone {
        padding: 30px 15px;
    }
}

/* ==================== ESTILOS PARA ORDENAMIENTO DE PROPIETARIOS ==================== */

/* Modo ordenamiento activo */
#propietarios-container.modo-ordenamiento tbody tr {
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

#propietarios-container.modo-ordenamiento tbody tr:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Elemento siendo arrastrado */
#propietarios-container tbody tr.dragging {
    opacity: 0.5;
    background-color: #dee2e6;
    border: 2px dashed #6c757d;
}

/* Zona de drop */
#propietarios-container tbody tr.drag-over {
    border-top: 3px solid #4CAF50;
    background-color: #e7f5e7;
}

/* Handle de arrastre */
.drag-handle {
    cursor: move;
    user-select: none;
    display: inline-block;
    vertical-align: middle;
}

/* Botón modo ordenamiento */
#btn-modo-ordenamiento {
    transition: all 0.3s ease;
}

#btn-modo-ordenamiento.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    animation: pulse 1.5s infinite;
}

#btn-modo-ordenamiento.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
}

/* Indicador visual de orden */
.orden-numero {
    font-weight: bold;
    color: #6c757d;
    font-size: 0.9em;
}

/* ==================== ESTILOS PARA TABLAS ORDENABLES ==================== */

/* Tabla ordenable */
.sortable-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px !important;
    transition: background-color 0.2s ease;
}

.sortable-table th[data-sort]:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Flechas de ordenamiento */
.sort-arrow {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
    opacity: 0.5;
    transition: opacity 0.2s ease, transform 0.2s ease;
    vertical-align: middle;
}

.sortable-table th[data-sort]:hover .sort-arrow {
    opacity: 0.8;
    transform: scale(1.2);
}

/* Flecha activa */
.sort-arrow.active {
    opacity: 1;
    color: #fff;
    font-weight: bold;
}

/* Animación al ordenar */
.sortable-table tbody {
    transition: opacity 0.2s ease;
}

.sortable-table tbody.sorting {
    opacity: 0.5;
}
