/* ==================== BASE STYLES ==================== */
/* Fondo degradado y textura sutil */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    min-height: 100vh;
    position: relative;
    margin: 0;
    padding: 0;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://www.transparenttextures.com/patterns/asfalt-dark.png');
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

/* ==================== LOADING SPINNER ==================== */
.loader {
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #3498db;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== NAVBAR MINIMALISTA ==================== */
.minimalist-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.2rem 2rem;
    margin-bottom: 1.5rem; /* Reducido de 2rem */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.minimalist-navbar:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Lado izquierdo */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    letter-spacing: -0.5px;
}

.navbar-welcome {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.employee-name {
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}
.navbar-status {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: rgba(72, 187, 120, 0.1);
    color: #38a169;
    border: 1px solid rgba(72, 187, 120, 0.2);
    transition: all 0.3s ease;
    margin-left: 3rem;
}

/* Estados del tiempo real */
.navbar-status.status-connecting {
    background: rgba(237, 137, 54, 0.1);
    color: #dd6b20;
    border-color: rgba(237, 137, 54, 0.2);
}

.navbar-status.status-error {
    background: rgba(229, 62, 62, 0.1);
    color: #c53030;
    border-color: rgba(229, 62, 62, 0.2);
}

/* Lado derecho */
.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-link {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;

}

.navbar-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.navbar-link:hover::before {
    left: 100%;
}

.navbar-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.navbar-link-danger {
    color: #e53e3e !important;
}

.navbar-link-danger:hover {
    color: #c53030 !important;
    background: rgba(229, 62, 62, 0.05) !important;
}

.navbar-separator {
    color: #cbd5e0;
    font-weight: 300;
    user-select: none;
}

/* ==================== PANEL PRINCIPAL DE GESTIÓN ==================== */
.ticket-management-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    margin-bottom: 1.5rem; /* Reducido de 2rem */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ticket-management-panel:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Header de gestión */
.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.75rem 2rem 1.25rem 2rem; /* Padding optimizado */
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Lado izquierdo del header */
.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.management-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    letter-spacing: -0.3px;
}

/* Contador de tickets */
.ticket-counter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.counter-badge {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
}

.counter-badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.counter-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Botón ver todos */
.view-all-button {
    font-size: 0.8rem;
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.view-all-button:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Lado derecho del header */
.header-right {
    display: flex;
    align-items: center;
}

/* Botón crear ticket */
.create-ticket-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.create-ticket-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.create-ticket-button:hover::before {
    left: 100%;
}

.create-ticket-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.button-icon {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* ==================== SECCIÓN DE FILTROS INTEGRADA ==================== */
.filters-section {
    padding: 1.25rem 2rem 1.75rem 2rem; /* Padding optimizado */
    background: rgba(248, 250, 252, 0.7);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filters-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-info {
    font-size: 0.9rem;
    color: #6b7280;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.clear-filters-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #4b5563;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Grid de filtros */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.date-input {
    font-size: 0.875rem;
}

/* Filtros activos */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.filter-tag {
    background: #667eea;
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInScale 0.3s ease-out;
}

.filter-tag .remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    padding: 0 0.25rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.filter-tag .remove:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== TABLA DE TICKETS ==================== */
.table-wrapper {
    margin-top: 0; /* Eliminamos margen superior */
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
    max-height: 70vh; /* Altura máxima responsiva */
    overflow-y: auto;
}

/* Tabla mejorada */
#ticketsTable {
    margin-bottom: 0 !important;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
}

#ticketsTable thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1.25rem 0.75rem;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

#ticketsTable thead th:first-child {
    border-top-left-radius: 16px;
}

#ticketsTable thead th:last-child {
    border-top-right-radius: 16px;
}

#ticketsTable tbody tr {
    transition: all 0.3s ease;
    border: none;
}

#ticketsTable tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#ticketsTable tbody tr:last-child td:first-child {
    border-bottom-left-radius: 16px;
}

#ticketsTable tbody tr:last-child td:last-child {
    border-bottom-right-radius: 16px;
}

#ticketsTable tbody td {
    padding: 1rem 0.75rem;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

#ticketsTable tbody tr:last-child td {
    border-bottom: none;
}

/* Scroll bar personalizada */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* ==================== ESTILOS DE CELDAS ==================== */
.ticket-id {
    font-weight: 700;
    color: #667eea;
    font-size: 14px;
}

.ticket-room {
    font-weight: 600;
    color: #2d3436;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.ticket-request {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-category {
    background: rgba(0, 184, 148, 0.1);
    color: #00b894;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
}

.ticket-date {
    font-size: 13px;
    color: #636e72;
}

/* ==================== ESTADOS DE TICKETS (BOTONES) ==================== */
.status-btn {
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-weight: bold !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    position: relative !important;
    overflow: hidden !important;
}

.status-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
}

.status-btn:active {
    transform: scale(0.95) !important;
}

/* Estados específicos */
.status-abierto {
    background-color: #ff7979 !important;
    color: white !important;
}

.status-abierto:hover {
    background-color: #e84c4c !important;
}

.status-en-progreso {
    background-color: #fdcb6e !important;
    color: #2d3436 !important;
}

.status-en-progreso:hover {
    background-color: #f39c12 !important;
}

.status-cerrado {
    background-color: #00b894 !important;
    color: white !important;
}

.status-cerrado:hover {
    background-color: #00a085 !important;
}

/* Efecto de carga al cambiar estado */
.status-btn.changing {
    pointer-events: none;
    opacity: 0.7;
}

.status-btn.changing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== PRIORIDADES ==================== */
.priority-alta {
    color: #fdcb6e;
    font-weight: bold;
}

.priority-urgente {
    color: #e11;
    font-weight: bold;
}

.priority-media {
    color: #00c9;
    font-weight: bold;
}

.priority-baja {
    color: #00b864;
    font-weight: bold;
}

/* ==================== BOTONES DE ACCIÓN ==================== */
.delete-btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 8px;
}

.delete-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

/* ==================== TOOLTIP PARA ESTADOS ==================== */
.status-tooltip {
    position: relative;
}

.status-tooltip::before {
    content: 'Click para cambiar estado: Abierto → En progreso → Cerrado → Abierto';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    margin-bottom: 5px;
}

.status-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.status-tooltip:hover::before,
.status-tooltip:hover::after {
    opacity: 1;
}

/* ==================== NOTIFICACIONES ==================== */
.notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== ANIMACIONES ADICIONALES ==================== */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ticket-management-panel {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.navbar-status.status-connecting {
    animation: pulse 2s infinite;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .minimalist-navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
        text-align: center;
    }

    .navbar-left {
        justify-content: center;
        gap: 1rem;
    }

    .navbar-title {
        font-size: 1.5rem;
    }

    .navbar-right {
        justify-content: center;
        gap: 0.75rem;
    }

    .navbar-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .navbar-separator {
        display: none;
    }

    .ticket-management-panel {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 12px;
    }

    .management-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding: 1.5rem 1.25rem 1rem 1.25rem;
    }

    .header-left {
        text-align: center;
    }

    .management-title {
        font-size: 1.35rem;
    }

    .ticket-counter {
        justify-content: center;
    }

    .header-right {
        justify-content: center;
    }

    .create-ticket-button {
        font-size: 0.9rem;
        padding: 0.7rem 1.3rem;
    }

    .filters-section {
        padding: 1rem 1.25rem 1.5rem 1.25rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .filters-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        text-align: center;
    }

    .filters-actions {
        justify-content: center;
    }

    .table-container {
        max-height: 60vh;
        border-radius: 12px;
    }

    #ticketsTable thead th {
        padding: 1rem 0.5rem;
        font-size: 0.7rem;
    }

    #ticketsTable tbody td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .navbar-left {
        flex-direction: column;
        gap: 0.75rem;
    }

    .navbar-right {
        flex-direction: column;
        gap: 0.5rem;
    }

    .navbar-link {
        width: 100%;
        text-align: center;
    }

    .ticket-counter {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .counter-badge,
    .view-all-button {
        font-size: 0.8rem;
    }

    .create-ticket-button {
        width: 100%;
        justify-content: center;
    }

    .filters-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .table-container {
        max-height: 50vh;
    }

    .ticket-request {
        max-width: 120px;
    }
}

@media (max-height: 800px) {
    .table-container {
        max-height: 50vh;
    }
}

@media (max-height: 600px) {
    .table-container {
        max-height: 40vh;
    }
}

/* ==================== EFECTOS GLASSMORPHISM ==================== */
.minimalist-navbar::before,
.ticket-management-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%);
    border-radius: 16px;
    pointer-events: none;
    z-index: -1;
}

/* ==================== ESTADOS DE TIEMPO REAL ==================== */
#realtime-status {
    transition: all 0.3s ease;
}

/* ==================== CORRECCIONES ESPECÍFICAS ==================== */

/* Fix para los selectores de filtros */
.filters-grid .select select {
    background-color: white;
    border: 1px solid #dbdbdb;
    color: #363636;
    font-size: 0.875rem;
}

.filters-grid .select select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 0.125em rgba(102, 126, 234, 0.25);
}

/* Fix para los inputs de fecha */
.filters-grid .input {
    background-color: white;
    border: 1px solid #dbdbdb;
    color: #363636;
    font-size: 0.875rem;
}

.filters-grid .input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 0.125em rgba(102, 126, 234, 0.25);
}

/* Fix para el placeholder del campo habitación */
.filters-grid .input::placeholder {
    color: #a0a0a0;
}

/* Fix para los badges del contador */
.counter-badge {
    white-space: nowrap;
}

/* Fix para los botones de estado en la tabla */
.status-abierto {
    background-color: #ff6b6b !important;
    color: white !important;
    border: none !important;
    padding: 0.375rem 0.75rem !important;
    border-radius: 15px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
}

.status-en-progreso {
    background-color: #feca57 !important;
    color: #2d3436 !important;
    border: none !important;
    padding: 0.375rem 0.75rem !important;
    border-radius: 15px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
}

.status-cerrado {
    background-color: #48c78e !important;
    color: white !important;
    border: none !important;
    padding: 0.375rem 0.75rem !important;
    border-radius: 15px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
}

/* Fix para las categorías en la tabla */
.ticket-category {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
}

/* Fix específico para categorías */
.ticket-category[data-category="mantenimiento"] {
    background-color: rgba(52, 152, 219, 0.1) !important;
    color: #3498db !important;
}

.ticket-category[data-category="servicio"] {
    background-color: rgba(155, 89, 182, 0.1) !important;
    color: #9b59b6 !important;
}

.ticket-category[data-category="limpieza"] {
    background-color: rgba(46, 204, 113, 0.1) !important;
    color: #2ecc71 !important;
}

/* Fix para las prioridades */
.priority-alta {
    color: #f39c12 !important;
    font-weight: 700 !important;
}

.priority-media {
    color: #3498db !important;
    font-weight: 600 !important;
}

.priority-baja {
    color: #27ae60 !important;
    font-weight: 600 !important;
}

.priority-urgente {
    color: #e74c3c !important;
    font-weight: 700 !important;
}

/* Fix para el ID de los tickets */
.ticket-id {
    color: #667eea !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
}

/* Fix para el botón de eliminar */
.delete-btn {
    background-color: #ff6b6b !important;
    color: white !important;
    border: none !important;
    padding: 0.375rem 0.75rem !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.delete-btn:hover {
    background-color: #ff5252 !important;
    transform: scale(1.05) !important;
}

/* Fix para el spacing de la tabla */
#ticketsTable tbody td {
    padding: 0.75rem !important;
    vertical-align: middle !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Fix para que los filtros activos se vean mejor */
.active-filters {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 100px;
        transform: translateY(0);
    }
}

/* Fix para los dropdowns de los filtros */
.filters-grid .select:not(.is-multiple):not(.is-loading)::after {
    border-color: #667eea;
    right: 1.125em;
    z-index: 4;
}

.filters-grid .select select:hover {
    border-color: #667eea;
}

/* Fix para el botón "Ver todos" */
.view-all-button {
    text-decoration: none !important;
}

.view-all-button:hover {
    text-decoration: none !important;
}

/* Fix para el responsive de la tabla */
@media (max-width: 768px) {
    #ticketsTable {
        font-size: 0.8rem;
    }

    #ticketsTable thead th {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.65rem !important;
    }

    #ticketsTable tbody td {
        padding: 0.5rem 0.25rem !important;
    }

    .status-abierto,
    .status-en-progreso,
    .status-cerrado {
        font-size: 0.65rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    .ticket-category {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
    }

    .delete-btn {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
}

/* Fix para centrar contenido en celdas pequeñas */
#ticketsTable tbody td:first-child,
#ticketsTable tbody td:last-child {
    text-align: center;
}

/* Fix para el texto de solicitud en móviles */
@media (max-width: 480px) {
    .ticket-request {
        max-width: 80px !important;
        font-size: 0.7rem !important;
    }
}

/* ================= THEME: Morado → Azul ================= */
:root{
    --brand-start:#6D28D9;   /* morado */
    --brand-end:#4F46E5;     /* azul indigo */
    --brand-soft:#eef2ff;    /* fondo suave */
    --card-border:#e6e9f3;
    --text-strong:#0f172a;
    --text:#1f2937;
}
#viewModal .modal-background{ background:rgba(15,17,42,.55)!important; }

/* Contenedor */
#viewModal .ticket-modal{
    border-radius:16px; box-shadow:0 20px 60px rgba(2,6,23,.25);
}

/* Header con gradiente */
#viewModal .themed__head{
    background:linear-gradient(135deg,var(--brand-start),var(--brand-end));
    border-bottom:none; color:#fff;
}
#viewModal .themed__title{
    color:#fff; display:flex; align-items:center; gap:.6rem;
    letter-spacing:.2px;
}
#viewModal .themed__title i{ font-size:1.05rem; }
#viewModal .themed__title .id-soft{ color:#dbeafe; font-weight:600; margin-left:.4rem; }

/* Body y Footer */
#viewModal .themed__body{ background:#fff; max-height:70vh; overflow:auto; padding:1.25rem 1.25rem; }
#viewModal .themed__foot{ background:#fff; border-top:1px solid var(--card-border); }

/* -------- Section cards -------- */
#viewModal .section-card{
    background:#fff; border:1px solid var(--card-border);
    border-radius:14px; padding:1rem 1rem 1.1rem; margin-bottom:1rem;
    box-shadow:0 6px 18px rgba(79,70,229,.06);
}
#viewModal .section-card__title{
    display:flex; align-items:center; gap:.5rem; font-weight:700;
    color:var(--text-strong); margin:.2rem 0 1rem;
    position:relative; padding-bottom:.6rem;
}
#viewModal .section-card__title::after{
    content:""; position:absolute; left:0; right:0; bottom:0;
    height:2px; background:linear-gradient(90deg,var(--brand-start),var(--brand-end));
    opacity:.15; border-radius:2px;
}
#viewModal .section-card__title i{ color:var(--brand-end); }

/* -------- Info pills (grid) -------- */
#viewModal .info-grid{
    display:grid; gap:.75rem 1rem; grid-template-columns:repeat(2,minmax(0,1fr));
}
#viewModal .info-pill{
    background:var(--brand-soft);
    border:1px solid #e0e7ff; color:var(--text);
    border-radius:10px; padding:.65rem .75rem;
}
#viewModal .info-pill--wide{ grid-column:1 / -1; }
#viewModal .info-pill strong{ color:var(--text-strong); margin-right:.35rem; }

/* -------- Chips (estado/prioridad) -------- */
#viewModal #view_estado_chip,#viewModal #view_prioridad_chip{
    font-weight:700; border:1px solid transparent;
}
/* -------- Chips (estado) -------- */
#viewModal .tag.is-open {
    background: #f87171;   /* rojo claro */
    color: #fff;
    border-color: #ef4444;
}
#viewModal .tag.is-progress {
    background: #facc15;   /* amarillo */
    color: #000000;
    border-color: #eab308;
}
#viewModal .tag.is-closed {
    background: #34d399;   /* verde esmeralda */
    color: #fff;
    border-color: #10b981;
}

/* -------- Chips (prioridad) -------- */
#viewModal .tag.is-low {
    background: #22c55e;   /* verde */
    color: #fff;
    border-color: #16a34a;
}
#viewModal .tag.is-medium {
    background: #3b82f6;   /* azul */
    color: #fff;
    border-color: #2563eb;
}
#viewModal .tag.is-high {
    background: #f59e0b;   /* naranja */
    color: #fff;
    border-color: #d97706;
}
#viewModal .tag.is-urgent {
    background: #dc2626;   /* rojo fuerte */
    color: #fff;
    border-color: #b91c1c;
}

/* -------- Solicitud (tipo transcript) -------- */
#viewModal .request-box{
    background:linear-gradient(180deg,#f8fafc, #f3f6ff);
    border:1px solid var(--card-border); border-radius:12px;
    padding:1rem; color:var(--text-strong); line-height:1.55;
    max-height:35vh; overflow:auto; white-space:pre-wrap;
}

/* Botón cerrar con icono alineado */
#viewModal .modal-card-foot .button i{ margin-right:.4rem; }

/* Responsive */
@media (max-width: 768px){
    #viewModal .ticket-modal{ max-width:95vw; }
    #viewModal .info-grid{ grid-template-columns:1fr; }
}
