/* ============================================
   UDEC Tickets - Dark Neon Theme (Exact Match)
   ============================================ */

:root {
    /* Colors - Exact Match */
    --bg-primary: #0d0f1a;
    --bg-secondary: #1a1d29;
    --bg-card: #252836;
    --border-neon: #4a5fd8;
    --border-neon-glow: rgba(74, 95, 216, 0.6);
    /* Accents */
    --accent-blue: #4a5fd8;
    --accent-blue-light: #6b7ce6;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-orange: #ff9800;
    --accent-red: #ef4444;
    /* Text */
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-title: #b8bfcf;
    /* Sizes */
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ============================================
   HEADER
   ============================================ */

.top-header {
    background: var(--bg-card);
    border: 1px solid rgba(74, 95, 216, 0.2);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin: 1.5rem 1.5rem 1rem 1.5rem;
    position: relative;
}

.top-header::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-neon), transparent);
    filter: blur(2px);
}

.header-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-title);
    margin-bottom: 0.25rem;
}

.header-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.header-info i {
    color: var(--accent-blue);
}

.header-info span {
    color: var(--accent-green);
    font-weight: 500;
}

/* ============================================
   STATS PANEL (COMPACT)
   ============================================ */

.stats-panel {
    display: flex;
    gap: 1.25rem;
    margin: 0 1.5rem 1.5rem 1.5rem;
    flex-wrap: wrap;
}

.stat-card-compact {
    flex: 1;
    min-width: 200px;
    background: rgba(37, 40, 54, 0.4);
    /* Border visible again */
    border: 1px solid rgba(74, 95, 216, 0.3);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.stat-card-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    /* Side bar restored */
    height: 100%;
    background: var(--border-neon);
    opacity: 0.8;
}

.stat-card-compact:hover {
    transform: translateY(-3px);
    background: rgba(37, 40, 54, 0.7);
    border-color: rgba(74, 95, 216, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon.bg-blue {
    background: linear-gradient(145deg, rgba(74, 95, 216, 0.25), rgba(74, 95, 216, 0.05));
    color: #818cf8;
    border: 1px solid rgba(74, 95, 216, 0.2);
}

.stat-icon.bg-yellow {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.05));
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.stat-icon.bg-green {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.25), rgba(16, 185, 129, 0.05));
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.stat-icon.bg-red {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.05));
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.stat-icon.bg-orange {
    background: linear-gradient(145deg, rgba(251, 146, 60, 0.25), rgba(251, 146, 60, 0.05));
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
}


.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn-neon {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--text-primary);
    padding: 0.625rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-neon:hover {
    background: var(--accent-blue);
    box-shadow: 0 0 15px var(--border-neon-glow);
    color: white;
}

.btn-neon-success {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.btn-neon-success:hover {
    background: var(--accent-green);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
    color: white;
}

.btn-neon-outline {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.btn-neon-outline:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* ============================================
   FILTER SECTION
   ============================================ */

.filter-section {
    background: var(--bg-card);
    border: 1px solid var(--border-neon);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    margin: 1.5rem;
    position: relative;
    box-shadow: 0 0 20px rgba(74, 95, 216, 0.15);
}

.filter-section::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, var(--border-neon) 50%, transparent 90%);
}

.filter-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-title);
    margin-bottom: 1.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label i {
    color: var(--accent-blue);
}

.glass-input {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border-radius: var(--border-radius);
    padding: 0.625rem 1rem;
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 3px rgba(74, 95, 216, 0.1) !important;
    outline: none;
}

.glass-input::placeholder {
    color: var(--text-muted);
}

.glass-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ============================================
   TABLE SECTION
   ============================================ */

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-neon);
    border-radius: var(--border-radius-lg);
    margin: 1.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(74, 95, 216, 0.15);
}

.table-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 10%, var(--border-neon) 50%, transparent 90%);
}

.table-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-title);
}

.table-actions {
    display: flex;
    gap: 0.75rem;
}

.data-table {
    width: 100%;
    margin-bottom: 0;
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead {
    background: rgba(74, 95, 216, 0.08);
}

.data-table thead th {
    padding: 1rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(74, 95, 216, 0.3);
    border-right: 1px solid rgba(74, 95, 216, 0.15);
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table thead th:last-child {
    border-right: none;
}

.data-table thead th i {
    margin-right: 0.5rem;
    color: var(--accent-blue);
}


.data-table tbody tr {
    /* border-bottom removed from tr */
    transition: all 0.2s ease;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(74, 95, 216, 0.08);
}

.data-table tbody td {
    padding: 0.85rem 1.25rem;
    font-size: 0.875rem;
    vertical-align: middle;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    /* Vertical */
    border-bottom: 1px solid rgba(74, 95, 216, 0.25);
    /* Horizontal (moved here) */
}

.data-table tbody td:last-child {
    border-right: none;
}


/* Columna Origen: no truncar */
.td-origen {
    white-space: nowrap;
    min-width: 200px;
}

/* Status Icons */
.status-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.status-icon.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.status-icon.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

/* Estado Badges */
.badge-nuevo {
    background: rgba(74, 95, 216, 0.15);
    color: #818cf8;
    border: 1px solid rgba(74, 95, 216, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
    white-space: nowrap;
}

.badge-esperando-respuesta {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
    white-space: nowrap;
}

.badge-derivado {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
    white-space: nowrap;
}

.badge-finalizado {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
    white-space: nowrap;
}

/* Legacy */
.badge-creada {
    background: rgba(74, 95, 216, 0.15);
    color: #818cf8;
    border: 1px solid rgba(74, 95, 216, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    display: inline-block;
}

.badge-enviada {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    display: inline-block;
}

/* Prioridad Badges */
.badge-alta {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    display: inline-block;
}

.badge-baja {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    display: inline-block;
}

.badge-media {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.35);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    display: inline-block;
}

.cb-media {
    background: #fb923c;
}

/* PLAZO badges */
.plazo-badge {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.plazo-ok {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.plazo-proximo {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.plazo-urgente {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.35);
}

.plazo-hoy {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    animation: pulsePlazo 1.4s ease infinite;
}

.plazo-vencido {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
    font-style: italic;
}

.plazo-done {
    background: rgba(99, 110, 114, 0.12);
    color: #636e72;
    border: 1px solid rgba(99, 110, 114, 0.2);
}

.plazo-unknown {
    background: transparent;
    color: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes pulsePlazo {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.55;
    }
}


.icon-badge {
    display: inline-block;
    font-size: 0.875rem;
    margin-right: 0.4rem;
    vertical-align: middle;
    opacity: 0.85;
}

.icon-badge.badge-hospital {
    color: #f87171;
}

.icon-badge.badge-centro {
    color: var(--accent-blue-light);
}

.icon-badge.badge-udec {
    color: #34d399;
}

.icon-badge.badge-otro {
    color: #fbbf24;
}

/* Cupos Badge */
.cupos-badge {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Libres Badge (Yellow) */
.libres-badge {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid rgba(255, 152, 0, 0.4);
    color: #ff9800;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.libres-badge i {
    font-size: 0.75rem;
}

/* Table Footer */
.table-footer {
    padding: 1rem 1.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================
   MODALS
   ============================================ */

.modal-content.glass-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-neon);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
}

.modal-title.gradient-text {
    font-weight: 600;
    color: var(--text-title);
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.25rem 1.5rem;
}

/* ============================================
   FILTER TAGS
   ============================================ */

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(74, 95, 216, 0.1);
    border: 1px solid rgba(74, 95, 216, 0.3);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--accent-blue-light);
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

.filter-tag .remove-filter {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    background: rgba(255, 255, 255, 0.1);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-tag .remove-filter:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   DETAIL VIEW
   ============================================ */

.detail-item {
    padding: 0.875rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideIn 0.5s ease-out forwards;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */

/* Barra debajo del header de la tabla */
.toggle-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.15);
}

/* Label clickeable que envuelve el switch + texto */
.toggle-switch-label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    user-select: none;
    margin: 0;
}

/* Contador de registros filtrados */
.toggle-filter-count {
    font-size: 0.8125rem;
    color: var(--accent-blue);
    font-weight: 500;
    display: none;
}

/* El div contenedor del switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: rgba(200, 200, 200, 0.9);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(74, 95, 216, 0.5);
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
    background-color: white;
}

/* Legacy classes */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.toggle-label {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.toggle-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue-light);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .top-header {
        margin: 1rem;
        padding: 1.5rem;
    }

    .filter-section {
        margin: 1rem;
        padding: 1.25rem;
    }

    .table-container {
        margin: 1rem;
        overflow-x: auto;
    }

    .data-table {
        min-width: 900px;
    }

    .stats-panel {
        margin: 0 1rem 1rem 1rem;
    }

    .stat-card-compact {
        min-width: 150px;
    }
}

/* Ticket Timeline/Expansion Row */
.ticket-timeline-row {
    display: none;
    background: rgba(0, 0, 0, 0.4);
}

.ticket-timeline-row.show {
    display: table-row;
}

.ticket-timeline-content {
    padding: 2rem;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    padding-left: 2.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-blue), transparent);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: -0.625rem;
    top: 0;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent-blue);
    z-index: 1;
}

.timeline-marker.completed {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.timeline-marker.current {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    box-shadow: 0 0 10px var(--accent-yellow);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.timeline-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.timeline-user {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-user i {
    color: var(--accent-blue);
}

.timeline-attachments {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeline-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(74, 95, 216, 0.1);
    border: 1px solid rgba(74, 95, 216, 0.3);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--accent-blue-light);
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-attachment:hover {
    background: rgba(74, 95, 216, 0.2);
    border-color: rgba(74, 95, 216, 0.5);
}

.timeline-attachment i {
    font-size: 0.875rem;
}

/* Expand/Collapse Button */
.btn-expand {
    background: transparent;
    border: none;
    color: var(--accent-blue);
    cursor: pointer;
    padding: 0.25rem;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-expand:hover {
    background: rgba(74, 95, 216, 0.15);
}

.btn-expand.expanded {
    transform: rotate(90deg);
}

/* ============================================
   TIMELINE MODAL STYLES
   ============================================ */

/* Timeline Header Info */
.timeline-header-info {
    background: rgba(74, 95, 216, 0.1);
    border: 1px solid rgba(74, 95, 216, 0.3);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.timeline-patient-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Timeline Container */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
    padding-left: 5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 3rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-blue), transparent);
}

.timeline-item:last-child::before {
    background: linear-gradient(to bottom, var(--accent-blue), var(--accent-blue) 30%, transparent);
}

.timeline-marker {
    position: absolute;
    left: 2.375rem;
    top: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent-blue);
    z-index: 1;
}

.timeline-marker.completed {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.timeline-marker.current {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.timeline-marker.pending {
    background: var(--bg-card);
    border-color: var(--accent-blue);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    }

    50% {
        box-shadow: 0 0 25px rgba(245, 158, 11, 0.8);
    }
}

/* Timeline Actions (Botones a la izquierda) */
.timeline-actions {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.timeline-item-header {
    position: relative;
}

.timeline-content {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    position: relative;
}

.timeline-content.editing {
    border-color: var(--accent-blue);
    background: rgba(74, 95, 216, 0.05);
}

.timeline-header {
    display: flex;
    flex-direction: column;
    /* Stack Title and Date */
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.25rem;
    padding-right: 5rem;
    /* Space for absolute actions */
}

/* ... existing timeline-title ... */

.timeline-absolute-actions {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

.timeline-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    flex-wrap: wrap;
    line-height: 1.4;
}

.timeline-title>i:not(.timeline-origen-badge i) {
    color: var(--accent-blue);
}

.timeline-origen-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    background: rgba(74, 95, 216, 0.15);
    border: 1px solid rgba(74, 95, 216, 0.4);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent-blue-light);
    text-transform: uppercase;
    margin-right: 0.5rem;
}

.timeline-origen-badge i {
    font-size: 0.7rem;
    color: var(--accent-blue);
}

.timeline-date {
    font-size: 0.85rem;
    margin-top: 0.15rem;
    /* Small Gap */
    opacity: 0.8;
}



.timeline-date i {
    color: var(--accent-blue);
}

.timeline-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.timeline-user {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    width: fit-content;
}

.timeline-user i {
    color: var(--accent-blue);
}

.timeline-attachments {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeline-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(74, 95, 216, 0.1);
    border: 1px solid rgba(74, 95, 216, 0.3);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--accent-blue-light);
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-attachment:hover {
    background: rgba(74, 95, 216, 0.2);
    border-color: rgba(74, 95, 216, 0.5);
    transform: translateY(-1px);
}

.timeline-attachment i {
    font-size: 0.875rem;
}

/* Timeline Edit Form */
.timeline-edit-form {
    padding: 0.5rem 0;
}

.timeline-edit-form .form-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.timeline-edit-form .glass-input {
    font-size: 0.9rem;
}

.timeline-edit-form textarea.glass-input {
    resize: vertical;
    min-height: 80px;
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-action:hover {
    background: rgba(74, 95, 216, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-action.history:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.btn-action.edit:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.btn-action.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Timeline Item Action Buttons */
.btn-timeline-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-timeline-action:hover {
    background: rgba(74, 95, 216, 0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-timeline-action.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Modal XL */
.modal-xl {
    max-width: 1140px;
}

/* Empty Timeline */
.empty-timeline {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-timeline i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Responsable Badge */
.responsable-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--accent-green);
    text-transform: uppercase;
}

/* Ticket Attachments Inline (en tabla) */
.ticket-attachments-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: rgba(74, 95, 216, 0.15);
    border: 1px solid rgba(74, 95, 216, 0.3);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--accent-blue-light);
}

.ticket-attachments-inline i {
    font-size: 0.7rem;
}

.ticket-attachments-inline span {
    font-weight: 600;
}

/* Action Buttons - Left aligned */
.action-buttons {
    display: flex;
    gap: 0.375rem;
    justify-content: flex-start;
}

/* === Filter Dropdown Checkboxes === */
.filter-dropdown {
    position: relative;
    display: inline-block;
}

.filter-dd-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(74, 95, 216, 0.3);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 180px;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.filter-dd-btn:hover,
.filter-dropdown.active .filter-dd-btn {
    background: rgba(74, 95, 216, 0.15);
    border-color: rgba(74, 95, 216, 0.5);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(74, 95, 216, 0.15);
}

.filter-dd-btn.has-filter {
    background: rgba(74, 95, 216, 0.22);
    border-color: rgba(74, 95, 216, 0.7);
    color: var(--text-primary);
    font-weight: 600;
}

.filter-dd-arrow {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
    margin-left: auto;
    padding-left: 0.5rem;
    opacity: 0.7;
}

.filter-dropdown.active .filter-dd-arrow {
    transform: rotate(180deg);
}

.filter-dd-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: var(--bg-card, #1a1d2e);
    border: 1px solid rgba(74, 95, 216, 0.35);
    border-radius: 12px;
    padding: 0.75rem;
    z-index: 200;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(74, 95, 216, 0.15);
}

.filter-dd-panel.open {
    display: flex;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
    width: 100%;
}

.filter-checkbox-item:hover {
    background: rgba(74, 95, 216, 0.15);
    color: var(--text-primary);
}

.filter-checkbox-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    position: relative;
}

.filter-checkbox-item input[type="checkbox"]:checked {
    background: var(--color-primary, #4a5fd8);
    border-color: var(--color-primary, #4a5fd8);
}

.filter-checkbox-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.filter-checkbox-item:has(input:checked) {
    color: var(--text-primary);
    font-weight: 600;
    background: rgba(74, 95, 216, 0.1);
}

/* Dots removed */
.cb-dot {
    display: none;
}


.filter-dd-btn:hover,
.filter-dropdown.active .filter-dd-btn {
    background: rgba(74, 95, 216, 0.12);
    border-color: rgba(74, 95, 216, 0.45);
    color: var(--text-primary);
}

.filter-dd-btn.has-filter {
    background: rgba(74, 95, 216, 0.18);
    border-color: rgba(74, 95, 216, 0.6);
    color: var(--text-primary);
    font-weight: 600;
}

.filter-dd-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    margin-left: auto;
    padding-left: 0.4rem;
}

.filter-dropdown.active .filter-dd-arrow {
    transform: rotate(180deg);
}

.filter-dd-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: var(--bg-card, #1a1d2e);
    border: 1px solid rgba(74, 95, 216, 0.3);
    border-radius: 10px;
    padding: 0.5rem;
    z-index: 200;
    display: none;
    flex-direction: column;
    gap: 0.15rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(74, 95, 216, 0.1);
}

.filter-dd-panel.open {
    display: flex;
    animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
    width: 100%;
}

.filter-checkbox-item:hover {
    background: rgba(74, 95, 216, 0.12);
    color: var(--text-primary);
}

.filter-checkbox-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    position: relative;
}

.filter-checkbox-item input[type="checkbox"]:checked {
    background: var(--color-primary, #4a5fd8);
    border-color: var(--color-primary, #4a5fd8);
}

.filter-checkbox-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0px;
    width: 4px;
    height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.filter-checkbox-item:has(input:checked) {
    color: var(--text-primary);
    font-weight: 600;
}

/* Color dot indicator */
.cb-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cb-alta {
    background: #ff4757;
}

.cb-baja {
    background: #2ed573;
}

.cb-nuevo {
    background: #4a5fd8;
}

.cb-esperando {
    background: #ffa502;
}

.cb-derivado {
    background: #a29bfe;
}

.cb-finalizado {
    background: #636e72;
}

.cb-hospital {
    background: #ff6b81;
}

.cb-cs {
    background: #26de81;
}

.cb-udec {
    background: #4a5fd8;
}

.cb-otro {
    background: #a0a0b0;
}

/* Badge Category */
.badge-category {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
}