/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Contenedor principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 20px 20px 20px;
}

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

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 300;
}

.login-card .subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

/* Reducir espaciado para formularios de usuario para evitar scroll */
#entityModal .form-group {
    margin-bottom: 8px;
}

#entityModal .form-group label {
    margin-bottom: 2px;
    font-size: 14px;
}

#entityModal .form-group input,
#entityModal .form-group select,
#entityModal .form-group textarea {
    padding: 8px;
    font-size: 14px;
    border-radius: 6px;
}

#entityModal .form-help {
    margin-top: 2px;
    font-size: 12px;
}

/* Reducir espaciado del modal para usuarios */
#entityModal .modal-body {
    padding: 15px 20px;
}

#entityModal .form-row-horizontal .form-group {
    margin-bottom: 8px;
}

/* Layout horizontal para campos tenant y password */
.form-row-horizontal {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.form-row-horizontal .form-group {
    flex: 1;
}

.form-row-horizontal .form-group:first-child {
    margin-right: 0;
}

@media (max-width: 768px) {
    .form-row-horizontal {
        flex-direction: column;
        gap: 0;
    }
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 0.85em;
    color: #666;
    font-style: italic;
}

/* Estilos para el saldo del cliente seleccionado en línea */
.saldo-cliente-inline {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

.saldo-cliente-inline .cliente-nombre {
    font-weight: 600;
    color: #495057;
    font-size: 1em;
    flex: 1;
    margin-right: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saldo-cliente-inline .saldo-monto-inline {
    font-weight: 700;
    color: #dc3545;
    font-size: 1.1em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Estilos para campos adicionales de cheques */
.cheque-fields {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cheque-fields .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    align-items: end;
}

.cheque-fields .form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
    margin-bottom: 6px;
}

.cheque-fields .form-group input,
.cheque-fields .form-group select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.9em;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.cheque-fields .form-group input:focus,
.cheque-fields .form-group select:focus {
    border-color: #667eea;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Estados de validación para CUIT */
.cheque-fields .form-group input.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 1.06 1.06L7.25 4.5l.94.94L4.3 9.5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.cheque-fields .form-group input.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4 1.4-1.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Responsive para campos de cheque */
@media (max-width: 768px) {
    .cheque-fields .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .cheque-fields .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Estilos del dashboard */
.dashboard {
    background: #f8f9fa;
    min-height: 100vh;
}

.header {
    background: white;
    padding: 12px 0;
    border-bottom: 1px solid #e1e1e1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2d5a2d;
    font-family: 'Huninn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tenant-info {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #c82333;
}

/* Grid de módulos */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.module-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.module-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 20px;
}

.module-card h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.3rem;
}

.module-card p {
    color: #666;
    line-height: 1.5;
}

/* Colores para diferentes módulos */
.module-pedidos .module-icon { background: #28a745; }
.module-clientes .module-icon { background: #007bff; }
.module-vehiculos .module-icon { background: #ffc107; color: #333; }
.module-choferes .module-icon { background: #17a2b8; }
.module-rutas .module-icon { background: #6f42c1; }
.module-direcciones .module-icon { background: #fd7e14; }
.module-tracking .module-icon { background: #dc3545; }
.module-eventos .module-icon { background: #20c997; }
.module-configuracion .module-icon { background: #6c757d; }
.module-users .module-icon { background: #343a40; }
.module-paradas .module-icon { background: #e83e8c; }
.module-matriz .module-icon { background: #6610f2; }
.module-admin-gps .module-icon { background: #ffc107; color: #333; }
.module-productos .module-icon { background: #28a745; }
.module-inventario-alquiler .module-icon { background: #17a2b8; }
.module-empresas .module-icon { background: #ffd700; color: #333; }
.module-medios-pago .module-icon { background: #4f46e5; }
.module-cobros .module-icon { background: #059669; }
.module-depositos .module-icon { background: #8b5cf6; }
.module-modalidades-alquiler .module-icon { background: #f59e0b; }
.module-tenants .module-icon { background: #dc2626; }
.module-retiros .module-icon { background: #e91e63; }
.module-configuracion .module-icon { background: #607d8b; }
.module-webhooks .module-icon { background: #eef2ff; color: #4f46e5; }
.module-configuracion-sistema .module-icon { background: #6366f1; }

/* Tabla de CRUD */
.crud-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 0 0 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

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

.crud-header h2 {
    color: #333;
    flex: 1;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
    text-decoration: none;
    color: white;
}

.btn-primary {
    background: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #0056b3;
    text-decoration: none;
    color: white;
}

/* Botones de acción - Solo iconos con tooltips */
.btn-action, .btn-sm, .direccion-actions button {
    position: relative;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
    padding: 0;
    margin: 0 2px;
    flex-shrink: 0;
}

/* Ocultar texto en botones de acción */
.btn-action span, .btn-sm span, .direccion-actions button span {
    display: none;
}

/* Colores específicos para cada tipo de acción */
.btn-view, .btn-info {
    background: #17a2b8;
    color: white;
}

.btn-view:hover, .btn-info:hover {
    background: #138496;
}

.btn-edit, .btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-edit:hover, .btn-warning:hover {
    background: #e0a800;
}

.btn-delete, .btn-danger {
    background: #dc3545;
    color: white;
}

.btn-delete:hover, .btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

/* Botón limpiar filtro */
#clearSearchButton {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    min-width: 80px; /* Ancho mínimo para mostrar "Limpiar" completo */
    white-space: nowrap;
    transition: all 0.3s ease;
    display: none;
}

#clearSearchButton:hover {
    background: #c82333;
    transform: translateY(-1px);
}

#clearSearchButton:active {
    transform: translateY(0);
}

/* Tooltips para botones de acción */
.btn-action[title]:hover::after,
.btn-sm[title]:hover::after,
.direccion-actions button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.btn-action[title]:hover::before,
.btn-sm[title]:hover::before,
.direccion-actions button[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Celdas de acciones en tablas */
td .action-buttons, 
td .rutas-actions-cell, 
td .direccion-actions {
    width: 100%;
    min-width: 120px;
}

/* Asegurar que las celdas de acciones no se contraigan */
table th:last-child,
table td:last-child {
    width: auto;
    min-width: 120px;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .login-card {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .btn-action, .btn-sm {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d1edff;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Estilos para gestión de direcciones de clientes */
.direcciones-section {
    margin-top: 20px;
}

.direccion-form {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.direcciones-grid {
    display: grid;
    gap: 10px;
}

.direccion-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.2s;
}

.direccion-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.direccion-item.activo {
    border-left: 4px solid #28a745;
}

.direccion-item.inactivo {
    border-left: 4px solid #6c757d;
    opacity: 0.8;
}

.direccion-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.direccion-actions .btn-sm {
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.direccion-actions .btn-warning {
    background: #ffc107;
    color: #212529;
}

.direccion-actions .btn-warning:hover {
    background: #e0a800;
}

.direccion-actions .btn-danger {
    background: #dc3545;
    color: white;
}

.direccion-actions .btn-danger:hover {
    background: #c82333;
}

.direccion-actions .btn-success {
    background: #28a745;
    color: white;
}

.direccion-actions .btn-success:hover {
    background: #218838;
}

.direccion-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.direccion-actions .btn-secondary:hover {
    background: #5a6268;
}

.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
}

.badge-info {
    color: #fff;
    background-color: #17a2b8;
}

.required {
    color: #dc3545;
}

/* Responsive para direcciones */
@media (max-width: 768px) {
    .direccion-item {
        padding: 10px;
    }
    
    .direccion-actions {
        margin-top: 10px;
        justify-content: flex-end;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Estilos para toggle de contraseña */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    flex: 1;
    padding-right: 50px; /* Espacio para el botón */
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #666;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 1;
    width: 32px;
    height: 32px;
}

.password-toggle:hover {
    background-color: #f0f0f0;
    color: #333;
}

.password-toggle:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.password-toggle:active {
    transform: scale(0.95);
}

.password-toggle i {
    pointer-events: none;
} 
/* Estilos para el modal de direcciones independiente */
#direccionesModal .cliente-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #28a745;
}

#direccionesModal .direcciones-actions {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
}

/* Botón de direcciones en la tabla */
.btn-sm.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
    margin-bottom: 5px;
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-sm.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Mejorar el layout de acciones en la tabla */
.action-buttons, .rutas-actions-cell, .direccion-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 4px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: fit-content;
}

/* Asegurar que las celdas de acciones mantengan el layout horizontal */
td .action-buttons {
    display: flex !important;
    flex-direction: row !important;
}

/* Responsivo para botones de acción */
@media (max-width: 768px) {
    .action-buttons, .rutas-actions-cell, .direccion-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 3px;
        justify-content: center;
    }
    
    .btn-sm {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .btn-sm i {
        font-size: 10px;
    }
}

/* Tabla de direcciones dentro del modal */
#direccionesModal .crud-table {
    font-size: 14px;
}

#direccionesModal .crud-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#direccionesModal .crud-table td {
    vertical-align: middle;
}

/* Estados y badges en el modal de direcciones */
.badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background-color: #28a745; }
.badge-info { background-color: #17a2b8; }
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-secondary { background-color: #6c757d; }

/* Loading states mejorados */
.loading-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-style: italic;
}

.loading-text i {
    animation: spin 1s linear infinite;
}

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

/* Estados de vacío mejorados */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
    color: #28a745;
}

.empty-state h4 {
    margin-bottom: 10px;
    color: #495057;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* Asegurar que el modal de entidades aparezca por delante del modal de direcciones */
#entityModal {
    z-index: 1100 !important;
}

#direccionesModal {
    z-index: 1050;
}

/* Asegurar que las ventanas modales tengan el z-index correcto */
.modal {
    z-index: 1000;
}

.modal#entityModal {
    z-index: 1100 !important;
}

.modal#direccionesModal {
    z-index: 1050;
}

.modal#viewModal {
    z-index: 1000;
}

.modal#lineaModal {
    z-index: 1000;
}

/* Estilos de paginación */
#pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #dee2e6;
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-controls button {
    background: #fff;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.pagination-controls button:hover:not(:disabled) {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
}

.pagination-controls button.current {
    background: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: 600;
}

.pagination-controls button:disabled {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-dots {
    color: #6c757d;
    padding: 0 8px;
    font-weight: 600;
}

/* Responsive para paginación */
@media (max-width: 768px) {
    #pagination {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-controls button {
        min-width: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .pagination-info {
        font-size: 13px;
    }
}

/* Estilos para la tabla principal de CRUD */
.crud-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.crud-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.crud-table td {
    padding: 8px 15px; /* Reducido de padding por defecto para menos espacio */
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
    line-height: 1; /* Reducido line-height para menos espacio entre líneas */
}

.crud-table tbody tr {
    transition: background-color 0.2s ease;
}

.crud-table tbody tr:hover {
    background-color: #f8f9fa;
}

.crud-table tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}

.crud-table tbody tr:nth-child(even):hover {
    background-color: #f0f2f5;
}

/* Asegurar que las celdas de acciones mantengan el ancho */
.crud-table th:last-child,
.crud-table td:last-child {
    width: 140px;
    min-width: 140px;
    text-align: center;
}

/* ========================================
   ESTILOS PARA FOTOS DE PRODUCTOS
   ======================================== */

.producto-fotos-manager {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    background: #ffffff;
}

.fotos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.fotos-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.contador-fotos {
    background: #007bff;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.fotos-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Zona de carga de archivos */
.foto-upload-zone {
    border: 2px dashed #d0d0d0;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.foto-upload-zone:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.foto-upload-zone.drag-over {
    border-color: #007bff;
    background: #e6f3ff;
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-content i {
    font-size: 48px;
    color: #007bff;
}

.upload-content p {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.upload-content small {
    color: #666;
    font-size: 12px;
}

/* Grid de fotos */
.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.foto-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: grab;
}

.foto-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.foto-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.foto-preview {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.foto-item:hover .foto-preview img {
    transform: scale(1.05);
}

.foto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.foto-item:hover .foto-overlay {
    opacity: 1;
}

.foto-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-principal {
    background: #ffc107;
    color: white;
}

.btn-principal:hover {
    background: #e0a800;
    transform: scale(1.1);
}

.btn-eliminar {
    background: #dc3545;
    color: white;
}

.btn-eliminar:hover {
    background: #c82333;
    transform: scale(1.1);
}

.foto-principal-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ffc107;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.foto-info {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.foto-info small {
    color: #666;
    font-size: 11px;
}

/* Indicador de carga */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: #007bff;
    font-size: 16px;
}

.loading-indicator i {
    margin-right: 10px;
}

/* Mensajes de notificación */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.message {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.message-success {
    border-left-color: #28a745;
    color: #155724;
}

.message-error {
    border-left-color: #dc3545;
    color: #721c24;
}

.message-warning {
    border-left-color: #ffc107;
    color: #856404;
}

.message i {
    font-size: 18px;
    opacity: 0.8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .fotos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .foto-preview {
        height: 120px;
    }
    
    .foto-upload-zone {
        padding: 30px 15px;
        min-height: 100px;
    }
    
    .upload-content i {
        font-size: 36px;
    }
    
    .upload-content p {
        font-size: 14px;
    }
    
    .message-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .fotos-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .foto-preview {
        height: 100px;
    }
    
    .btn-action {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .fotos-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

.crud-header .header-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #eef2ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    font-size: 18px;
}