/* =====================================================
   TICKETS LIST — REDESIGN PROFESIONAL
   ===================================================== */

/* --- HEADER BAR --- */
.tl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 8px 8px 0 0;
    padding: 0 16px;
    min-height: 56px;
    border-bottom: none;
    flex-wrap: wrap;
    gap: 6px;
}

.tl-header-left {
    display: flex;
    align-items: center;
}

.tl-tabs {
    display: flex;
    align-items: center;
    height: 56px;
}

.tl-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 56px;
    font-size: 13px;
    font-weight: 500;
    color: #7b8190;
    text-decoration: none !important;
    border-bottom: 3px solid transparent;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.tl-tab:hover { color: #4e5e6a; text-decoration: none !important; }
.tl-tab.active { color: #1d2c48; border-bottom-color: #4466f2; font-weight: 600; }
.tl-tab svg { flex-shrink: 0; opacity: .75; }
.tl-tab.active svg { opacity: 1; color: #4466f2; }

/* --- HEADER RIGHT BUTTONS --- */
.tl-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    flex-wrap: wrap;
}

.tl-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
    line-height: 1;
}
.tl-btn svg { flex-shrink: 0; }

.tl-btn-ghost { background: #fff; border-color: #e2e4e7; color: #4e5e6a; }
.tl-btn-ghost:hover { background: #f3f4f8; border-color: #c8cad3; color: #1d2c48; }

.tl-btn-primary { background: #4466f2; border-color: #4466f2; color: #fff !important; }
.tl-btn-primary:hover { background: #3355e0; border-color: #3355e0; color: #fff !important; }

/* --- TABLE CARD --- */
.tl-table-card {
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* --- TABLE HEADERS --- */
.tl-redesign #ticket-table_wrapper table.dataTable thead th {
    background: #f7f8fb;
    color: #7b8190;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 11px 14px;
    border-bottom: 1px solid #e8eaf0 !important;
    border-top: none !important;
    white-space: nowrap;
}

/* --- TABLE ROWS --- */
.tl-redesign #ticket-table_wrapper table.dataTable tbody td {
    padding: 11px 14px;
    font-size: 13px;
    vertical-align: middle;
    border-top: none !important;
}
.tl-redesign #ticket-table_wrapper table.dataTable tbody tr {
    border-bottom: 1px solid #f0f1f5;
}
.tl-redesign #ticket-table_wrapper table.dataTable tbody tr:last-child { border-bottom: none; }

.tl-redesign #ticket-table_wrapper table.dataTable tbody td:nth-child(3) a {
    font-weight: 600; color: #4466f2; font-size: 12.5px;
}
.tl-redesign #ticket-table_wrapper table.dataTable tbody td.all a { font-weight: 500; }

/* Badge refinement */
.tl-redesign #ticket-table_wrapper .badge {
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 4px 9px !important;
    border-radius: 20px !important;
    letter-spacing: .02em;
}

/* Left status border */
.tl-redesign #ticket-table_wrapper .list-status-border {
    border-left-width: 3px !important;
    border-left-style: solid !important;
}

/* Pagination current */
.tl-redesign #ticket-table_wrapper .dataTables_paginate .paginate_button {
    border-radius: 5px !important;
    font-size: 12.5px;
    padding: 4px 10px !important;
    border: 1px solid transparent !important;
    margin: 0 2px;
}
.tl-redesign #ticket-table_wrapper .dataTables_paginate .paginate_button.current {
    background: #4466f2 !important;
    border-color: #4466f2 !important;
    color: #fff !important;
}

/* =====================================================
   DARK MODE — body[data-color] overrides
   Colores oscuros: #252932 bg, #2f3541 border, #898fa9 text
   ===================================================== */

body[data-color="1E202D"] .tl-header,
body[data-color="1d2632"] .tl-header,
body[data-color="2e4053"] .tl-header,
body[data-color="404040"] .tl-header,
body[data-color="555a61"] .tl-header,
body[data-color="2e4053"] .tl-header {
    background: #252932 !important;
    border-color: #2f3541 !important;
}

body[data-color="1E202D"] .tl-header-left,
body[data-color="1d2632"] .tl-header-left,
body[data-color="2e4053"] .tl-header-left,
body[data-color="404040"] .tl-header-left,
body[data-color="555a61"] .tl-header-left {
    border-color: #2f3541 !important;
}

body[data-color="1E202D"] .tl-tab,
body[data-color="1d2632"] .tl-tab,
body[data-color="2e4053"] .tl-tab,
body[data-color="404040"] .tl-tab,
body[data-color="555a61"] .tl-tab { color: #898fa9; }

body[data-color="1E202D"] .tl-tab.active,
body[data-color="1d2632"] .tl-tab.active,
body[data-color="2e4053"] .tl-tab.active,
body[data-color="404040"] .tl-tab.active,
body[data-color="555a61"] .tl-tab.active { color: #ccc; }

body[data-color="1E202D"] .tl-btn-ghost,
body[data-color="1d2632"] .tl-btn-ghost,
body[data-color="2e4053"] .tl-btn-ghost,
body[data-color="404040"] .tl-btn-ghost,
body[data-color="555a61"] .tl-btn-ghost {
    background: #2B2E3B !important;
    border-color: #2f3541 !important;
    color: #898fa9 !important;
}
body[data-color="1E202D"] .tl-btn-ghost:hover,
body[data-color="1d2632"] .tl-btn-ghost:hover,
body[data-color="2e4053"] .tl-btn-ghost:hover,
body[data-color="404040"] .tl-btn-ghost:hover,
body[data-color="555a61"] .tl-btn-ghost:hover {
    background: #343747 !important;
    color: #ccc !important;
}

body[data-color="1E202D"] .tl-table-card,
body[data-color="1d2632"] .tl-table-card,
body[data-color="2e4053"] .tl-table-card,
body[data-color="404040"] .tl-table-card,
body[data-color="555a61"] .tl-table-card {
    background: #252932 !important;
    border-color: #2f3541 !important;
}

body[data-color="1E202D"] .tl-redesign #ticket-table_wrapper table.dataTable thead th,
body[data-color="1d2632"] .tl-redesign #ticket-table_wrapper table.dataTable thead th,
body[data-color="2e4053"] .tl-redesign #ticket-table_wrapper table.dataTable thead th,
body[data-color="404040"] .tl-redesign #ticket-table_wrapper table.dataTable thead th,
body[data-color="555a61"] .tl-redesign #ticket-table_wrapper table.dataTable thead th {
    background: #1C1F26 !important;
    color: #898fa9 !important;
    border-color: #2f3541 !important;
}

body[data-color="1E202D"] .tl-redesign #ticket-table_wrapper table.dataTable tbody tr,
body[data-color="1d2632"] .tl-redesign #ticket-table_wrapper table.dataTable tbody tr,
body[data-color="2e4053"] .tl-redesign #ticket-table_wrapper table.dataTable tbody tr,
body[data-color="404040"] .tl-redesign #ticket-table_wrapper table.dataTable tbody tr,
body[data-color="555a61"] .tl-redesign #ticket-table_wrapper table.dataTable tbody tr {
    border-color: #2f3541;
}

/* =====================================================
   MOBILE — max-width: 767px
   ===================================================== */

@media (max-width: 767px) {

    .tl-redesign.page-wrapper { padding: 10px; }

    .tl-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 12px;
        gap: 0;
        min-height: unset;
        border-radius: 8px 8px 0 0;
    }

    .tl-header-left {
        width: 100%;
        border-bottom: 1px solid #e8eaf0;
    }

    .tl-tabs {
        width: 100%;
        overflow-x: auto;
        height: 46px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tl-tabs::-webkit-scrollbar { display: none; }

    .tl-tab { height: 46px; padding: 0 10px; font-size: 12.5px; flex-shrink: 0; }

    /* Botones en fila scrollable — nunca se desbordan fuera del card */
    .tl-header-right {
        width: 100%;
        padding: 8px 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px;
    }
    .tl-header-right::-webkit-scrollbar { display: none; }

    .tl-btn { flex-shrink: 0; font-size: 12px; padding: 6px 10px; }
}