:root {
    --morado: #6f42c1;
    --morado-oscuro: #5a359c;
    --morado-claro: #8c68cd;
    --verde: #28a745;
    --verde-oscuro: #218838;
    --verde-claro: #34ce57;
}

/* Mejoras generales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #aaeea7;
}

/* Navbar mejorada */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 2px;
}

.navbar-dark .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Sidebar mejorado */
.sidebar {
    background: linear-gradient(180deg, var(--morado) 0%, var(--morado-oscuro) 100%);
    color: white;
    min-height: calc(100vh - 56px);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar .list-group-item {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    border-radius: 8px !important;
}

.sidebar .list-group-item:hover,
.sidebar .list-group-item.active {
    background-color: rgba(255,255,255,0.15);
    color: white;
    transform: translateX(5px);
}

.sidebar .list-group-item i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

/* Cards mejoradas */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.card-header {
    background: white;
    border-bottom: 2px solid #e9ecef;
    border-radius: 12px 12px 0 0 !important;
    padding: 15px 20px;
    font-weight: 600;
}

/* Botones mejorados */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
}

.btn-purple {
    background: linear-gradient(45deg, var(--morado), var(--morado-claro));
    border: none;
    color: white;
}

.btn-purple:hover {
    background: linear-gradient(45deg, var(--morado-oscuro), var(--morado));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
    color: white;
}

.btn-green {
    background: linear-gradient(45deg, var(--verde), var(--verde-claro));
    border: none;
    color: white;
}

.btn-green:hover {
    background: linear-gradient(45deg, var(--verde-oscuro), var(--verde));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    color: white;
}

/* Tablas mejoradas */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background-color: var(--morado);
    color: white;
    border: none;
    padding: 15px 12px;
    font-weight: 600;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-color: #0be20b;
}

.table-hover tbody tr:hover {
    background-color: rgba(111, 66, 193, 0.05);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Badges mejorados */
.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.badge-estado {
    border: 1px solid transparent;
    text-decoration-color: #cc33eb;

}

/* Stats cards mejoradas */
.stats-card {
    text-align: center;
    padding: 25px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

.stats-card h3 {
    font-size: 2.2rem;
    margin: 10px 0;
    font-weight: 700;
}

.stats-card p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Formularios mejorados */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--morado);
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25);
}

/* Quick actions */
.quick-actions {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.3s ease;
    height: 100%;
}

.quick-action-btn:hover {
    border-color: var(--morado);
    color: var(--morado);
    transform: translateY(-3px);
}

.quick-action-btn i {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

/* IP Access Button */
.btn-ip-access {
    background: linear-gradient(45deg, #17a2b8, #20c997);
    border: none;
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-ip-access:hover {
    background: linear-gradient(45deg, #138496, #1e9e8a);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        margin-bottom: 20px;
    }
    
    .stats-card {
        margin-bottom: 15px;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
}

/* Loading animations */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--morado);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--morado-oscuro);
}


/* Mejoras específicas para el Dashboard */
.sidebar {
    background: linear-gradient(180deg, #6f42c1 0%, #5a359c 50%, #4a2d82 100%);
    color: white;
    min-height: 100vh;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
}

.sidebar-header {
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.sidebar-menu .list-group-item {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    padding: 15px 20px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu .list-group-item:hover,
.sidebar-menu .list-group-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: #28a745;
    transform: translateX(5px);
}

.sidebar-menu .list-group-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Quick Actions Mejoradas */
.quick-actions-enhanced .card {
    background: linear-gradient(135deg, #6f42c1 0%, #8c68cd 100%);
    border: none;
    border-radius: 15px;
}

.quick-action-enhanced {
    display: block;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    padding: 10px 5px;
    border-radius: 10px;
}

.quick-action-enhanced:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
    color: white;
}

.action-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.quick-action-enhanced:hover .action-icon {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.action-text {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Estadísticas Mejoradas */
.stats-card-enhanced {
    border: none;
    border-radius: 15px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stats-card-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.stats-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255,255,255,0.3);
}

.stats-card-enhanced.bg-gradient-primary {
    background: linear-gradient(135deg, #6f42c1 0%, #8c68cd 100%);
}

.stats-card-enhanced.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.stats-card-enhanced.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.stats-card-enhanced.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

.stats-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    opacity: 0.3;
}

.stats-content h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stats-content p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.stats-trend {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Mini Stats Cards */
.mini-stats-card {
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mini-stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.mini-stats-icon {
    font-size: 1.5rem;
}

/* Gradientes para headers de cards */
.bg-gradient-purple {
    background: linear-gradient(135deg, #6f42c1 0%, #8c68cd 100%) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%) !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #6f42c1 0%, #007bff 100%) !important;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%) !important;
}

/* Elementos específicos del dashboard */
.service-distribution-item,
.technician-item,
.payment-status-item {
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
}

.service-distribution-item:last-child,
.technician-item:last-child,
.payment-status-item:last-child {
    border-bottom: none;
}

.service-icon,
.technician-avatar,
.payment-icon,
.client-avatar,
.ticket-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.technician-avatar {
    background: #e8f5e8;
}

.payment-icon {
    background: #e3f2fd;
}

.client-avatar {
    background: #f3e5f5;
}

.ticket-icon {
    background: #fff3e0;
}

.technician-rank .badge {
    font-size: 0.7rem;
}

/* Texto con gradiente */
.text-gradient {
    background: linear-gradient(135deg, #6f42c1 0%, #28a745 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Progress bars personalizadas */
.progress {
    border-radius: 10px;
    background: #f1f3f4;
}

.progress-bar {
    border-radius: 10px;
}

/* List groups personalizadas */
.list-group-item {
    border: none;
    padding: 15px 20px;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background: #f8f9fa;
}

/* Badges mejorados */
.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-content h3 {
        font-size: 1.8rem;
    }
    
    .stats-icon {
        font-size: 2rem;
    }
    
    .quick-action-enhanced {
        padding: 5px 2px;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .action-text {
        font-size: 0.75rem;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease-out;
}

/* Efectos de hover mejorados */
.btn-outline-purple {
    border-color: #6f42c1;
    color: #6f42c1;
}

.btn-outline-purple:hover {
    background: #6f42c1;
    color: white;
}

/* Scroll personalizado para el sidebar */
.sidebar-menu {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}


/* Estilos para el modal de resumen */
.modal-resumen .card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.modal-resumen .card-header {
    border-bottom: 2px solid;
    font-weight: 600;
}

.modal-resumen .table-sm td {
    padding: 4px 8px;
    border: none;
}

.modal-resumen .badge {
    font-size: 0.75rem;
}

.ticket-item {
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.ticket-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .modal-resumen .row > div {
        margin-bottom: 15px;
    }
    
    .modal-resumen .card-body {
        padding: 10px;
    }
}

/* Animaciones para el modal */
.modal.fade .modal-dialog {
    transform: translate(0, -50px);
    transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
    transform: translate(0, 0);
}


/* Estilos para los filtros */
.filter-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-row {
    align-items: end;
}

.filter-group {
    margin-bottom: 0;
}

.filter-group label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 5px;
    color: #495057;
}

/* Estilos para headers ordenables */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
    padding-right: 25px !important;
}

.sortable-header:hover {
    background-color: rgba(111, 66, 193, 0.1) !important;
}

.sort-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.sortable-header:hover .sort-icon {
    color: #6f42c1;
}

/* Contador de resultados */
.results-counter {
    background: linear-gradient(135deg, #6f42c1, #8c68cd);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Botones de filtro */
.btn-filter {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-filter:hover {
    background: #218838;
    color: white;
    transform: translateY(-2px);
}

.btn-clear {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-clear:hover {
    background: #5a6268;
    color: white;
    transform: translateY(-2px);
}

/* Estilos responsive para filtros */
@media (max-width: 768px) {
    .filter-row .col-md-3 {
        margin-bottom: 15px;
    }
    
    .filter-buttons {
        text-align: center;
        margin-top: 10px;
    }
    
    .filter-buttons .btn {
        margin: 0 5px;
    }
}

/* Efectos para la tabla */
.table-hover tbody tr {
    transition: all 0.3s ease;
}

.table-hover tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}


/* Estilos para las alertas de eliminación */
.animated {
    animation-duration: 0.5s;
}

.bounceIn {
    animation-name: bounceIn;
}

@keyframes bounceIn {
    from, 20%, 40%, 60%, 80%, to {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }
    0% {
        opacity: 0;
        transform: scale3d(.3, .3, .3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(.9, .9, .9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(.97, .97, .97);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

/* Estilos para tooltips */
.tooltip {
    font-size: 0.8rem;
}

/* Mejoras para los botones de acción */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Efectos hover para botones de acción */
.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #6f42c1;
    border-color: #6f42c1;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.btn-outline-info:hover {
    background-color: #17a2b8;
    border-color: #17a2b8;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    transform: scale(1.1);
    transition: all 0.3s ease;
}


/* Estilos para paginación */
.pagination .page-item.active .page-link {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: white;
}

.pagination .page-link {
    color: #6f42c1;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    color: #5a359c;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
}

/* Estilos para el botón cargar más */
#btnCargarMas {
    transition: all 0.3s ease;
}

#btnCargarMas:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
}

/* Animación para nuevas filas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#tablaClientes tbody tr:last-child {
    animation: fadeInUp 0.5s ease-out;
}


/* Estilos para el formulario de ticket con cliente pre-seleccionado */
.card.border-success {
    border-width: 2px !important;
}

/* Estilos para el select de cliente pre-seleccionado */
select[data-preselected] {
    border-left: 4px solid #28a745 !important;
    background-color: #f8fff9;
}

/* Badge para indicar pre-selección */
.badge.bg-success {
    font-size: 0.7em;
    padding: 3px 6px;
}

/* Estilos para la información del cliente */
.cliente-info-card .card-header {
    padding: 0.5rem 1rem;
}

.cliente-info-card .card-body {
    padding: 0.75rem 1rem;
}

/* Animación para el formulario */
.form-control:focus {
    border-color: #6f42c1;
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25);
}

/* Estilos para los botones de acción rápida */
.btn-outline-warning {
    transition: all 0.3s ease;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
    transform: scale(1.05);
}



/* Estilos para los campos de búsqueda */
.form-control:focus {
    border-color: #6f42c1;
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.25);
}

.input-group-text {
    transition: all 0.3s ease;
    border-color: #ced4da;
}

.form-control:focus + .input-group-text {
    background-color: #6f42c1 !important;
    border-color: #6f42c1;
    color: white !important;
}

/* Contador de resultados */
#contadorResultados {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    transition: all 0.3s ease;
    min-height: 20px;
}

/* Botón de limpiar */
.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}