/* ====================================================================
   ESTILOS AVANZADOS PARA DXGRID - SISTEMA TAREOS
   ================================================================== */

/* === ESTILOS GENERALES DEL GRID === */
.grid-toolbar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem 0.375rem 0 0;
}

.compact-grid {
    font-size: 0.875rem;
}

.compact-grid .dx-grid-header {
    height: 35px !important;
}

.compact-grid .dx-data-row {
    height: 32px !important;
}

/* === ESTILOS DE COLUMNAS FIJAS === */
.dx-grid-fixed-columns .dx-grid-selection-column {
    background: rgba(13, 110, 253, 0.05);
    border-right: 2px solid #0d6efd;
}

/* === ESTILOS DE CELDAS PERSONALIZADAS === */
.meta-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.description-cell {
    max-width: 200px;
}

.avatar-sm {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

/* === ESTILOS DE BADGES Y ESTADOS === */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.fs-6 {
    font-size: 0.8rem !important;
}

/* === ESTILOS DE TOOLBAR === */
.grid-info {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.export-menu {
    min-width: 150px;
}

.export-menu .btn {
    justify-content: flex-start;
    text-align: left;
}

/* === ESTILOS DE DETALLES === */
.tareo-detail-row {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin: 0.5rem;
}

.tareo-detail-row .table {
    margin-bottom: 0;
}

.tareo-detail-row .table td:first-child {
    color: #6c757d;
    font-size: 0.875rem;
    width: 120px;
}

/* === ESTILOS DE ÁREA VACÍA === */
.empty-data-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    margin: 2rem;
}

.empty-data-area .fa-inbox {
    opacity: 0.5;
}

/* === ESTILOS DE FILTROS === */
.dx-filter-row .dx-texteditor {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.dx-filter-row .dx-texteditor.dx-state-focused {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* === ESTILOS DE AGRUPACIÓN === */
.dx-group-row {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
    border-left: 4px solid #0d6efd;
    font-weight: 600;
}

.dx-group-row.dx-group-row-expanded {
    background: linear-gradient(135deg, #cff4fc 0%, #e7f3ff 100%);
    border-left-color: #0dcaf0;
}

/* === ESTILOS DE RESUMEN === */
.dx-grid-summary-item {
    background: rgba(13, 110, 253, 0.1);
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* === ESTILOS DE PAGINACIÓN === */
.dx-pager {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0.75rem;
}

.dx-pages .dx-page {
    border-radius: 0.25rem;
    margin: 0 2px;
}

.dx-pages .dx-page.dx-selection {
    background: #0d6efd;
    color: white;
}

/* === ESTILOS DE SELECCIÓN === */
.dx-selection .dx-data-row {
    background: rgba(13, 110, 253, 0.1) !important;
    border-left: 3px solid #0d6efd;
}

/* === ESTILOS DE HOVER === */
.dx-data-row:hover {
    background: rgba(13, 110, 253, 0.05) !important;
    transform: translateY(-1px);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === ESTILOS DE ENCABEZADOS === */
.dx-grid-header {
    background: linear-gradient(135deg, #212529 0%, #495057 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.dx-grid-header .dx-sort-indicator {
    color: #0dcaf0;
}

/* === ESTILOS DE BOTONES DE ACCIÓN === */
.btn-group-sm .btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 0.2rem;
}

.btn-group .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-group .btn:not(:first-child):not(:last-child) {
    border-radius: 0;
}

/* === ESTILOS DE PROGRESO === */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(45deg, #28a745, #20c997);
    font-size: 0.75rem;
    font-weight: 600;
}

/* === ESTILOS RESPONSIVE === */
@media (max-width: 768px) {
    .grid-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .grid-toolbar .toolbar-item {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }

    .tareo-detail-row .row {
        flex-direction: column;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .btn-group .btn {
        border-radius: 0.25rem !important;
        margin-bottom: 2px;
    }
}

/* === ANIMACIONES === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dx-data-row {
    animation: fadeInUp 0.3s ease-out;
}

/* === ESTILOS DE EXPORTACIÓN === */
.export-menu .btn:hover {
    transform: translateX(3px);
    transition: transform 0.2s ease;
}

/* === ESTILOS DE CONFIGURACIÓN === */
.grid-config-panel {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1rem;
}

/* === ESTILOS PARA MENÚS DE FILTRO === */
.dx-filter-menu .dx-list-item {
    padding: 0.5rem;
    border-bottom: 1px solid #f1f3f4;
}

.dx-filter-menu .dx-list-item:hover {
    background: rgba(13, 110, 253, 0.1);
}

/* === ESTILOS DE VALIDACIÓN === */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* === ESTILOS DE CARGA === */
.dx-loading-indicator {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.dx-loading-indicator .dx-loadpanel-content {
    background: linear-gradient(135deg, #0d6efd, #0dcaf0);
    color: white;
    border-radius: 0.5rem;
    padding: 1rem;
}

/* === ESTILOS DE TOOLTIPS === */
.dx-tooltip {
    background: rgba(33, 37, 41, 0.95);
    color: white;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    padding: 0.5rem;
}

/* === ESTILOS PARA TEXTO TRUNCADO === */
.text-truncate-custom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

/* === ESTILOS DE ICONOS === */
.fa-stack {
    position: relative;
    display: inline-block;
    width: 2em;
    height: 2em;
    line-height: 2em;
    vertical-align: middle;
}

.status-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-icon.active { background: #28a745; }
.status-icon.inactive { background: #6c757d; }
.status-icon.suspended { background: #ffc107; }
.status-icon.review { background: #17a2b8; }
.status-icon.approved { background: #28a745; }
.status-icon.rejected { background: #dc3545; }
.status-icon.finished { background: #6f42c1; }

/* === ESTILOS DARK MODE (FUTURO) === */
@media (prefers-color-scheme: dark) {
    .grid-toolbar {
        background: linear-gradient(135deg, #212529 0%, #343a40 100%);
        color: white;
    }

    .dx-grid-header {
        background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    }

    .tareo-detail-row {
        background: linear-gradient(135deg, #343a40 0%, #495057 100%);
        color: white;
    }
}