/**
 * TabManager - Estilos de la barra de pestañas internas
 * Integrado con AdminLTE 2.x + Bootstrap 3
 */

/* ── Barra de pestañas ─────────────────────────────────────────────────── */
#tab-nav-wrapper {
    display: flex;
    align-items: flex-end;
    background: #f4f4f4;
    border-bottom: 1px solid #ddd;
    padding: 5px 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

#main-tabs {
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    border-bottom: none;
    margin-bottom: -1px;
}

#main-tabs::-webkit-scrollbar {
    height: 4px;
}

#main-tabs::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 2px;
}

#main-tabs > li {
    display: inline-block;
    float: none;
    flex-shrink: 0;
}

#main-tabs > li > a {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 4px 4px 0 0;
    color: #555;
    white-space: nowrap;
    margin-right: 2px;
}

#main-tabs > li > a:hover {
    background: #e9e9e9;
    border-color: #ddd #ddd transparent;
}

#main-tabs > li.active > a,
#main-tabs > li.active > a:hover,
#main-tabs > li.active > a:focus {
    background: #fff;
    border: 1px solid #ddd;
    border-bottom-color: #fff;
    color: #333;
    font-weight: 600;
}

/* Título truncado en pestañas muy largas */
#main-tabs .tab-title {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

/* Pestaña Dashboard fija (sin botón de cierre) */
#tab-li-dashboard > a {
    color: #384152;
    font-weight: 600;
}

/* ── Botón de cierre por pestaña ───────────────────────────────────────── */
.tab-close-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    margin-left: 6px;
    padding: 0 2px;
    vertical-align: middle;
}

.tab-close-btn:hover {
    color: #c0392b;
}

/* ── Acciones de la barra (cerrar todas) ───────────────────────────────── */
#tab-bar-actions {
    flex-shrink: 0;
    padding: 0 4px 6px 8px;
}

/* ── Paneles de contenido ──────────────────────────────────────────────── */
#main-tab-content > .tab-pane {
    padding: 0;
}

#main-tab-content > .tab-pane:not(.active) {
    display: none !important;
}

#main-tab-content > .tab-pane.active {
    display: block;
}

#main-tab-content .tab-section,
#main-tab-content > .tab-pane > .content {
    padding: 15px;
}

/* Spinner de carga */
.tab-loading {
    padding: 60px 0;
    color: #aaa;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    #main-tabs > li > a {
        padding: 6px 8px;
        font-size: 12px;
    }

    #main-tabs .tab-title {
        max-width: 90px;
    }
}
