/**
 * Estilos del Módulo de Tickets
 * Incluye solo estilos específicos que Bootstrap no cubre
 * Se priorizan clases Bootstrap siempre que sea posible
 * Mejorado con colores dinámicos y efectos visuales
 */

/* ========================================
   KANBAN BOARD - Vista de Lista
   ======================================== */

.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex: 1;
    min-width: 0;
}

.kanban-column {
    flex: 0 0 320px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.75rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.kanban-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.kanban-cards {
    min-height: 250px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.kanban-cards.compact {
    min-height: 200px;
    max-height: calc(100vh - 220px);
}

.kanban-cards.expanded {
    min-height: 300px;
    max-height: calc(100vh - 280px);
}

/* Scrollbar personalizado para las columnas */
.kanban-cards::-webkit-scrollbar {
    width: 6px;
}

.kanban-cards::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.kanban-cards::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.kanban-cards::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ========================================
   TICKET CARDS
   ======================================== */

.ticket-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ticket-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #6f42c1, #e83e8c);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ticket-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px) scale(1.02);
}

.ticket-card:hover::before {
    opacity: 1;
}

.ticket-card.dragging {
    opacity: 0.6;
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.ticket-business i {
    font-size: 0.6rem;
}

.ticket-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Colores dinámicos por categoría */
.ticket-card.category-bug {
    border-left: 4px solid #dc3545;
}

.ticket-card.category-feature {
    border-left: 4px solid #0d6efd;
}

.ticket-card.category-improvement {
    border-left: 4px solid #0dcaf0;
}

.ticket-card.category-support {
    border-left: 4px solid #ffc107;
}

.ticket-card.category-question {
    border-left: 4px solid #6c757d;
}

.ticket-card.category-documentation {
    border-left: 4px solid #198754;
}

/* Botón de asignación rápida en tarjetas */
.btn-assign-quick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid currentColor;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.btn-assign-quick:hover {
    transform: scale(1.15);
    background: currentColor;
    color: white !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-assign-quick i {
    line-height: 1;
}

/* Avatar con colores dinámicos */
.assignee-avatar.dynamic-color {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.assignee-avatar.color-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.assignee-avatar.color-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.assignee-avatar.color-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

.assignee-avatar.color-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.assignee-avatar.color-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.assignee-avatar.color-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333 !important;
}

/* ========================================
   PRIORIDADES - Colores específicos mejorados
   ======================================== */

.priority-high {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.priority-medium {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
    color: #333;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(254, 202, 87, 0.3);
}

.priority-low {
    background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(72, 219, 251, 0.3);
}

.priority-critical {
    background: linear-gradient(135deg, #ff3838 0%, #ff2d92 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(255, 56, 56, 0.4);
    animation: pulse-critical 2s infinite;
}

@keyframes pulse-critical {
    0%,
    100% {
        box-shadow: 0 2px 8px rgba(255, 56, 56, 0.4);
    }
    50% {
        box-shadow: 0 2px 15px rgba(255, 56, 56, 0.6);
    }
}

/* ========================================
   ASIGNADOS
   ======================================== */

.assignee-avatar {
    width: 24px;
    height: 24px;
}

/* ========================================
   ESTADOS POR COLUMNA - Identificadores visuales
   ======================================== */

.status-nuevo {
    border-left: 4px solid #007bff;
}

.status-proceso {
    border-left: 4px solid #ffc107;
}

.status-revision {
    border-left: 4px solid #17a2b8;
}

.status-completado {
    border-left: 4px solid #28a745;
}

/* ========================================
   FORMULARIO DE TICKETS - TABS
   ======================================== */

#ticketTabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

#ticketTabs .nav-link:hover {
    border-bottom-color: #007bff;
}

#ticketTabs .nav-link.active {
    border-bottom-color: #007bff;
}

.tab-content {
    min-height: 400px;
}

/* ========================================
   ADJUNTOS - FILE MANAGER
   ======================================== */

#attachmentsList {
    min-height: 150px;
}

.attachment-preview-item {
    transition: all 0.2s ease;
}

.attachment-preview-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.attachment-thumbnail {
    width: 80px;
    height: 80px;
    overflow: hidden;
}

.attachment-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   ANIMACIONES
   ======================================== */

@keyframes attachmentSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.attachment-preview-item {
    animation: attachmentSlideIn 0.3s ease-out;
}

.attachment-removing {
    animation: attachmentSlideOut 0.3s ease-out forwards;
}

@keyframes attachmentSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

@keyframes highlight {
    0%,
    100% {
        background-color: white;
    }
    50% {
        background-color: #fff3cd;
    }
}

/* ========================================
   GALERÍA DE ADJUNTOS - ESTILO MINIATURAS
   ======================================== */

.attachment-thumb {
    overflow: hidden;
    transition: all 0.3s ease;
    animation: attachmentSlideIn 0.4s ease-out;
}

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

.attachment-thumb img {
    transition: transform 0.3s ease;
}

.attachment-thumb:hover img {
    transform: scale(1.05);
}

.attachment-thumb-icon {
    width: 100%;
    aspect-ratio: 1/1;
}

.attachment-thumb-icon i {
    font-size: 3rem;
}

.attachment-thumb-fallback {
    width: 100%;
    aspect-ratio: 1/1;
}

.attachment-thumb-fallback i {
    font-size: 2.5rem;
}

.attachment-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.attachment-thumb:hover .attachment-actions {
    opacity: 1;
}

.btn-attachment-remove {
    background: rgba(220, 53, 69, 0.9);
    transition: all 0.2s ease;
}

.btn-attachment-remove:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

.attachment-index {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 123, 255, 0.9);
}

.attachment-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-thumb.attachment-removing {
    animation: attachmentFadeOut 0.3s ease-out forwards;
}

@keyframes attachmentFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* ========================================
   SISTEMA DE ETIQUETAS (TAGS) - Select2
   ======================================== */

.select2-selection--multiple .select2-selection__rendered {
    gap: 0.5rem;
    min-height: 38px;
}

.select2-selection--multiple .select2-selection__choice {
    background: #0d6efd !important;
    color: white !important;
    border: none !important;
    padding: 0.375rem 0.75rem !important;
    margin: 0 !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.select2-selection--multiple .select2-selection__choice__remove {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    margin-left: 0.5rem !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.select2-selection--multiple .select2-selection__choice__remove:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.1) !important;
}

.select2-container .select2-selection--multiple .select2-search__field {
    min-width: 120px !important;
    height: 32px !important;
}

.select2-container--bootstrap-5 .select2-dropdown {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@keyframes tagFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   ESTILOS DE ETIQUETAS (TAGS)
   ======================================== */

.select2-selection__choice {
    animation: tagFadeIn 0.3s ease-out;
    border: none !important;
    border-radius: 0.5rem !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0.125rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

.select2-selection__choice:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.select2-selection__choice__remove {
    color: inherit !important;
    opacity: 0.7 !important;
    font-weight: bold !important;
    margin-right: 0.25rem !important;
    transition: opacity 0.2s ease !important;
}

.select2-selection__choice__remove:hover {
    opacity: 1 !important;
}

/* Color único para todas las etiquetas */
.select2-container
    .select2-selection--multiple
    .select2-selection__choice.tag-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%) !important;
    color: white !important;
}

/* Estilo especial para etiquetas personalizadas (nuevas) */
.select2-container
    .select2-selection--multiple
    .select2-selection__choice[title*="nueva"]::after {
    content: "✨";
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Mejoras para el contenedor de etiquetas */
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 3rem !important;
    max-height: 8rem !important;
    overflow-y: auto !important;
    padding: 0.5rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid #ced4da !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple:focus {
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Contenedor de etiquetas renderizadas */
.select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.25rem !important;
    padding: 0 !important;
    width: 100% !important;
}

/* Campo de búsqueda más ancho */
.select2-search--inline .select2-search__field {
    min-width: 8rem !important;
    flex: 1 !important;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 0.25rem 0.5rem !important;
}

/* Scroll personalizado para el contenedor */
.select2-container--bootstrap-5
    .select2-selection--multiple::-webkit-scrollbar {
    width: 6px;
}

.select2-container--bootstrap-5
    .select2-selection--multiple::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.select2-container--bootstrap-5
    .select2-selection--multiple::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.select2-container--bootstrap-5
    .select2-selection--multiple::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mejoras adicionales para mejor experiencia */
.select2-selection__choice {
    max-width: 200px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Indicador visual cuando hay muchas etiquetas */
.select2-container--bootstrap-5 .select2-selection--multiple:not(:focus) {
    position: relative;
}

.select2-container--bootstrap-5
    .select2-selection--multiple:not(:focus)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.8));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.select2-container--bootstrap-5
    .select2-selection--multiple[style*="overflow-y: auto"]::after {
    opacity: 1;
}

/* Mejorar el botón de limpiar todo */
.select2-selection__clear {
    color: #dc3545 !important;
    font-weight: bold !important;
    font-size: 1.2rem !important;
    padding: 0.25rem !important;
    margin-right: 0.5rem !important;
    transition: all 0.2s ease !important;
}

.select2-selection__clear:hover {
    color: #a71e2a !important;
    transform: scale(1.1) !important;
}

/* ========================================
   MODAL DE PREVISUALIZACIÓN
   ======================================== */

#ticketPreviewModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
}

#ticketPreviewModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

#ticketPreviewModal .card {
    transition: all 0.3s ease;
}

#ticketPreviewModal .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

#ticketPreviewModal pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
}

#ticketPreviewModal h6.text-muted {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#ticketPreviewModal.show .modal-dialog {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   DASHBOARD DE MÉTRICAS SIDEBAR
   ======================================== */

.kanban-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.metrics-sidebar {
    width: 200px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
}

.metrics-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.metrics-header h6 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.metric-item:hover {
    background: rgba(0, 0, 0, 0.03);
    transform: translateX(2px);
}

.metric-icon-sidebar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 123, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon-sidebar i {
    font-size: 0.9rem;
}

.metric-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.metric-value-sidebar {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 0.125rem;
}

.metric-label-sidebar {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6c757d;
}

/* Separador entre grupos de métricas */
.metrics-divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.1) 20%,
        rgba(0, 0, 0, 0.1) 80%,
        transparent 100%
    );
    margin: 0.75rem 0;
}

/* Colores específicos para cada métrica sidebar */
.metric-icon-sidebar.text-primary {
    background: rgba(13, 110, 253, 0.1);
}

.metric-icon-sidebar.text-danger {
    background: rgba(220, 53, 69, 0.1);
}

.metric-icon-sidebar.text-warning {
    background: rgba(255, 193, 7, 0.1);
}

.metric-icon-sidebar.text-success {
    background: rgba(25, 135, 84, 0.1);
}

.metric-icon-sidebar.text-info {
    background: rgba(13, 202, 240, 0.1);
}

/* Animación para los valores sidebar */
.metric-value-sidebar {
    animation: metricCountUp 0.6s ease-out;
}

@keyframes metricCountUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   BARRA DE BÚSQUEDA
   ======================================== */

#searchBar {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#searchInput {
    border-radius: 0.375rem 0 0 0.375rem;
}

#searchInput:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ========================================
   MODAL DE FILTROS AVANZADOS
   ======================================== */

#advancedFiltersModal .modal-content {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

#advancedFiltersModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
}

#advancedFiltersModal .btn-close {
    filter: brightness(0) invert(1);
}

#advancedFiltersModal .form-label {
    color: #495057;
    margin-bottom: 0.5rem;
}

#advancedFiltersModal .form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

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

#advancedFiltersModal .form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: all 0.3s ease;
}

#advancedFiltersModal .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

#advancedFiltersModal .modal-footer {
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* ========================================
   FILTROS RÁPIDOS
   ======================================== */

#quickFilters .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

#quickFilters .btn {
    transition: all 0.2s ease;
    font-weight: 500;
}

#quickFilters .btn.active {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#quickFilters .btn:hover:not(.active) {
    transform: translateY(-1px);
}

/* Indicador de filtro activo */
#filterIndicator {
    animation: filterPulse 2s infinite;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

@keyframes filterPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ========================================
   PANELES DE ESTADÍSTICAS
   ======================================== */

.stats-panel {
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
}

.stats-panel.show {
    opacity: 1;
    transform: translateY(0);
}

.stats-panel .card {
    border: none;
    background: linear-gradient(
        135deg,
        rgba(248, 249, 250, 0.8) 0%,
        rgba(233, 236, 239, 0.6) 100%
    );
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.stats-panel .card-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.stats-item:last-child {
    margin-bottom: 0;
}

.stats-item small {
    font-size: 0.75rem;
    font-weight: 500;
}

.stats-item .fw-bold {
    font-size: 0.875rem;
}

/* ========================================
   COMPACTA Y EXPANDIDA
   ======================================== */

.kanban-column.compact .stats-panel {
    display: none;
}

.kanban-column.compact .kanban-cards {
    min-height: 120px;
}

.kanban-column.expanded .stats-panel {
    display: block;
}

.kanban-column.expanded .kanban-cards {
    min-height: 200px;
}

/* ========================================
   ANIMACIONES MEJORADAS
   ======================================== */

@keyframes metricCountUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.metric-value {
    animation: metricCountUp 0.6s ease-out;
}

@keyframes statsSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.stats-item {
    animation: statsSlideIn 0.4s ease-out;
    animation-fill-mode: both;
}

.stats-item:nth-child(1) {
    animation-delay: 0.1s;
}
.stats-item:nth-child(2) {
    animation-delay: 0.2s;
}
.stats-item:nth-child(3) {
    animation-delay: 0.3s;
}

/* ========================================
   RESPONSIVE MEJORADO
   ======================================== */

@media (max-width: 768px) {
    .kanban-container {
        flex-direction: column;
        gap: 1rem;
    }

    .metrics-sidebar {
        width: 100%;
        position: static;
        order: -1;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .metrics-header {
        grid-column: 1 / -1;
        text-align: center;
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    }

    .metrics-divider {
        display: none;
    }

    .metrics-sidebar .metric-item {
        display: flex;
        width: 100%;
        padding: 0.75rem;
        background: rgba(0, 0, 0, 0.02);
        border-radius: 0.5rem;
    }
}

@media (max-width: 576px) {
    #ticketTabs .nav-link i {
        display: none;
    }

    .kanban-column {
        flex: 0 0 280px;
    }

    .metrics-sidebar {
        padding: 0.75rem;
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-item {
        width: 100%;
        gap: 0.5rem;
        padding: 0.625rem;
    }

    .metric-icon-sidebar {
        width: 28px;
        height: 28px;
    }

    .metric-icon-sidebar i {
        font-size: 0.8rem;
    }

    .metric-value-sidebar {
        font-size: 1rem;
    }

    .metric-label-sidebar {
        font-size: 0.6rem;
    }

    #quickFilters .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (max-width: 768px) {
    .kanban-board {
        gap: 1rem;
    }

    .metric-card {
        margin-bottom: 1rem;
    }

    .stats-panel {
        margin-top: 1rem;
    }
}

@media (max-width: 992px) {
    .kanban-cards {
        max-height: calc(100vh - 320px);
    }

    .kanban-cards.compact {
        max-height: calc(100vh - 280px);
    }

    .kanban-cards.expanded {
        max-height: calc(100vh - 350px);
    }
}
